Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix radio button group change event usages #3330

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { styleMap, type StyleInfo } from 'lit/directives/style-map.js';
import { sbbSpread } from '../../../storybook/helpers/spread.js';
import type { SbbFormErrorElement } from '../../form-error.js';

import type { SbbRadioButtonGroupElement } from './radio-button-group.js';
import readme from './readme.md?raw';
import './radio-button-group.js';
import '../radio-button.js';
Expand Down Expand Up @@ -145,8 +146,8 @@ const ErrorMessageTemplate = (args: Args): TemplateResult => {
return html`
<sbb-radio-button-group
${sbbSpread(args)}
@change=${(event: CustomEvent) => {
if (event.detail.value) {
@change=${(event: Event) => {
if ((event.currentTarget as SbbRadioButtonGroupElement).value) {
sbbFormError.remove();
} else if (args.required) {
(event.target as HTMLElement).closest('sbb-radio-button-group')?.append(sbbFormError);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ class FullscreenDiff extends LitElement {
return html``;
}
return html`<div class="app-labels">
<sbb-chip-label size="xxs" color="white"
>${this.screenshotFiles.browserName}</sbb-chip-label
>
<sbb-chip-label size="xxs" color="white">
${this.screenshotFiles.browserName}
</sbb-chip-label>
<sbb-chip-label size="xxs" color="white">${this.screenshotFiles.viewport}</sbb-chip-label>
</div>
<sbb-radio-button-group
class="app-radio-button-group"
value=${this.selectedFile}
@change=${(event: Event) =>
(this.selectedFile = (event.target as SbbRadioButtonGroupElement).value as DiffFileType)}
(this.selectedFile = (event.currentTarget as SbbRadioButtonGroupElement)
.value as DiffFileType)}
>
${!this.screenshotFiles.isNew
? html`<sbb-radio-button value="baselineFile">Baseline</sbb-radio-button>`
Expand Down
Loading