diff --git a/src/components.d.ts b/src/components.d.ts index af0bef2aafc..776c1ac6fe1 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -3181,7 +3181,7 @@ declare namespace LocalJSX { /** * Internal event that emits when the input element is loaded. */ - "onInput-loaded"?: (event: SbbCheckboxCustomEvent) => void; + "onSbb-checkbox-loaded"?: (event: SbbCheckboxCustomEvent) => void; "onState-change"?: (event: SbbCheckboxCustomEvent) => void; /** * Whether the checkbox is required. @@ -4183,7 +4183,7 @@ declare namespace LocalJSX { /** * Internal event that emits when the input element is loaded. */ - "onInput-loaded"?: (event: SbbRadioButtonCustomEvent) => void; + "onSbb-radio-button-loaded"?: (event: SbbRadioButtonCustomEvent) => void; /** * Internal event that emits whenever the state of the radio option in relation to the parent selection panel changes. */ diff --git a/src/components/sbb-checkbox/readme.md b/src/components/sbb-checkbox/readme.md index 3efb9c43037..99f48a87a0d 100644 --- a/src/components/sbb-checkbox/readme.md +++ b/src/components/sbb-checkbox/readme.md @@ -85,10 +85,10 @@ If you don't want the label to appear next to the checkbox, you can use `aria-la ## Events -| Event | Description | Type | -| -------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------- | -| `didChange` | **[DEPRECATED]** only used for React. Will probably be removed once React 19 is available.

| `CustomEvent` | -| `input-loaded` | Internal event that emits when the input element is loaded. | `CustomEvent` | +| Event | Description | Type | +| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------- | +| `didChange` | **[DEPRECATED]** only used for React. Will probably be removed once React 19 is available.

| `CustomEvent` | +| `sbb-checkbox-loaded` | Internal event that emits when the input element is loaded. | `CustomEvent` | ## Slots diff --git a/src/components/sbb-checkbox/sbb-checkbox.events.ts b/src/components/sbb-checkbox/sbb-checkbox.events.ts index c9723719fff..2b5485d0a96 100644 --- a/src/components/sbb-checkbox/sbb-checkbox.events.ts +++ b/src/components/sbb-checkbox/sbb-checkbox.events.ts @@ -4,6 +4,6 @@ */ export default { didChange: 'didChange', - inputLoaded: 'input-loaded', + sbbCheckboxLoaded: 'sbb-checkbox-loaded', stateChange: 'state-change', }; diff --git a/src/components/sbb-checkbox/sbb-checkbox.tsx b/src/components/sbb-checkbox/sbb-checkbox.tsx index c882ee72cb0..c390c69d199 100644 --- a/src/components/sbb-checkbox/sbb-checkbox.tsx +++ b/src/components/sbb-checkbox/sbb-checkbox.tsx @@ -120,9 +120,9 @@ export class SbbCheckbox implements ComponentInterface { */ @Event({ bubbles: true, - eventName: 'input-loaded', + eventName: 'sbb-checkbox-loaded', }) - public inputLoaded: EventEmitter; + public sbbCheckboxLoaded: EventEmitter; @Watch('checked') public handleCheckedChange(currentValue: boolean, previousValue: boolean): void { @@ -177,7 +177,7 @@ export class SbbCheckbox implements ComponentInterface { !this._element.closest('sbb-selection-panel [slot="content"]'); this._handlerRepository.connect(); this._setupInitialStateAndAttributeObserver(); - this.inputLoaded.emit(); + this._isSelectionPanelInput && this.sbbCheckboxLoaded.emit(); } public componentDidLoad(): void { diff --git a/src/components/sbb-radio-button-group/sbb-radio-button-group.tsx b/src/components/sbb-radio-button-group/sbb-radio-button-group.tsx index bb8952e87d3..9945a12057a 100644 --- a/src/components/sbb-radio-button-group/sbb-radio-button-group.tsx +++ b/src/components/sbb-radio-button-group/sbb-radio-button-group.tsx @@ -187,7 +187,7 @@ export class SbbRadioButtonGroup implements ComponentInterface { } private _updateRadios(initValue?: string): void { - this.value = initValue || this._radioButtons.find((radio) => radio.checked)?.value; + this.value = initValue ?? this._radioButtons.find((radio) => radio.checked)?.value; for (const radio of this._radioButtons) { radio.checked = radio.value === this.value; diff --git a/src/components/sbb-radio-button/readme.md b/src/components/sbb-radio-button/readme.md index b41ea8ad739..4e01d0c054e 100644 --- a/src/components/sbb-radio-button/readme.md +++ b/src/components/sbb-radio-button/readme.md @@ -56,10 +56,10 @@ The component has two different sizes, which can be changed using the `size` pro ## Events -| Event | Description | Type | -| -------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | -| `input-loaded` | Internal event that emits when the input element is loaded. | `CustomEvent` | -| `state-change` | Internal event that emits whenever the state of the radio option in relation to the parent selection panel changes. | `CustomEvent` | +| Event | Description | Type | +| ------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | +| `sbb-radio-button-loaded` | Internal event that emits when the input element is loaded. | `CustomEvent` | +| `state-change` | Internal event that emits whenever the state of the radio option in relation to the parent selection panel changes. | `CustomEvent` | ## Methods diff --git a/src/components/sbb-radio-button/sbb-radio-button.events.ts b/src/components/sbb-radio-button/sbb-radio-button.events.ts index 3ef983a72ee..1c945bf4717 100644 --- a/src/components/sbb-radio-button/sbb-radio-button.events.ts +++ b/src/components/sbb-radio-button/sbb-radio-button.events.ts @@ -3,6 +3,6 @@ * See stencil.config.ts in the root directory. */ export default { - inputLoaded: 'input-loaded', + sbbRadioButtonLoaded: 'sbb-radio-button-loaded', stateChange: 'state-change', }; diff --git a/src/components/sbb-radio-button/sbb-radio-button.tsx b/src/components/sbb-radio-button/sbb-radio-button.tsx index ed9912977a4..8f97400f846 100644 --- a/src/components/sbb-radio-button/sbb-radio-button.tsx +++ b/src/components/sbb-radio-button/sbb-radio-button.tsx @@ -125,9 +125,9 @@ export class SbbRadioButton implements ComponentInterface { */ @Event({ bubbles: true, - eventName: 'input-loaded', + eventName: 'sbb-radio-button-loaded', }) - public inputLoaded: EventEmitter; + public sbbRadioButtonLoaded: EventEmitter; @Watch('checked') public handleCheckedChange(currentValue: boolean, previousValue: boolean): void { @@ -178,7 +178,7 @@ export class SbbRadioButton implements ComponentInterface { !!this._selectionPanelElement && !this._element.closest('sbb-selection-panel [slot="content"]'); this._setupInitialStateAndAttributeObserver(); - this.inputLoaded.emit(); + this._isSelectionPanelInput && this.sbbRadioButtonLoaded.emit(); } public componentDidLoad(): void {