From 7e76d03ccff6b7011da98ba2af8e0ed11895113b Mon Sep 17 00:00:00 2001 From: Jeremias Peier Date: Tue, 24 Dec 2024 14:27:19 +0100 Subject: [PATCH] docs: fix radio button group change event usages --- .../radio-button-group/radio-button-group.stories.ts | 5 +++-- .../image-diff/fullscreen-diff/fullscreen-diff.ts | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/elements/radio-button/radio-button-group/radio-button-group.stories.ts b/src/elements/radio-button/radio-button-group/radio-button-group.stories.ts index 862200a5c8..127517c342 100644 --- a/src/elements/radio-button/radio-button-group/radio-button-group.stories.ts +++ b/src/elements/radio-button/radio-button-group/radio-button-group.stories.ts @@ -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'; @@ -145,8 +146,8 @@ const ErrorMessageTemplate = (args: Args): TemplateResult => { return html` { - 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); diff --git a/src/visual-regression-app/src/components/test-case/image-diff/fullscreen-diff/fullscreen-diff.ts b/src/visual-regression-app/src/components/test-case/image-diff/fullscreen-diff/fullscreen-diff.ts index 21bd1df563..43a49435d4 100644 --- a/src/visual-regression-app/src/components/test-case/image-diff/fullscreen-diff/fullscreen-diff.ts +++ b/src/visual-regression-app/src/components/test-case/image-diff/fullscreen-diff/fullscreen-diff.ts @@ -30,16 +30,17 @@ class FullscreenDiff extends LitElement { return html``; } return html`
- ${this.screenshotFiles.browserName} + + ${this.screenshotFiles.browserName} + ${this.screenshotFiles.viewport}
- (this.selectedFile = (event.target as SbbRadioButtonGroupElement).value as DiffFileType)} + (this.selectedFile = (event.currentTarget as SbbRadioButtonGroupElement) + .value as DiffFileType)} > ${!this.screenshotFiles.isNew ? html`Baseline`