Skip to content

Commit

Permalink
docs: fix radio button group change event usages
Browse files Browse the repository at this point in the history
  • Loading branch information
jeripeierSBB committed Dec 24, 2024
1 parent 3752a57 commit 7e76d03
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
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

0 comments on commit 7e76d03

Please sign in to comment.