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

fix(various): ensure slotchange event is handled properly in hydration #2897

Merged
merged 1 commit into from
Jul 8, 2024
Merged
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
3 changes: 2 additions & 1 deletion src/elements/stepper/stepper/stepper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getNextElementIndex, isArrowKeyPressed } from '../../core/a11y.js';
import { SbbConnectedAbortController } from '../../core/controllers.js';
import { breakpoints, isBreakpoint } from '../../core/dom.js';
import type { SbbHorizontalFrom, SbbOrientation } from '../../core/interfaces.js';
import { SbbHydrationMixin } from '../../core/mixins.js';
import type { SbbStepElement, SbbStepValidateEventDetails } from '../step.js';

import style from './stepper.scss?lit&inline';
Expand All @@ -24,7 +25,7 @@ const DEBOUNCE_TIME = 150;
* @slot step - Use this slot to provide an `sbb-step`.
*/
@customElement('sbb-stepper')
export class SbbStepperElement extends LitElement {
export class SbbStepperElement extends SbbHydrationMixin(LitElement) {
public static override styles: CSSResultGroup = style;

/** If set to true, only the current and previous labels can be clicked and selected. */
Expand Down
3 changes: 2 additions & 1 deletion src/elements/tabs/tab-group/tab-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ref } from 'lit/directives/ref.js';
import { getNextElementIndex, isArrowKeyPressed } from '../../core/a11y.js';
import { SbbConnectedAbortController } from '../../core/controllers.js';
import { EventEmitter, throttle } from '../../core/eventing.js';
import { SbbHydrationMixin } from '../../core/mixins.js';
import { AgnosticMutationObserver, AgnosticResizeObserver } from '../../core/observers.js';
import type { SbbTabLabelElement } from '../tab-label.js';
import { SbbTabElement } from '../tab.js';
Expand Down Expand Up @@ -52,7 +53,7 @@ let nextId = 0;
* @event {CustomEvent<SbbTabChangedEventDetails>} didChange - Emits an event on selected tab change.
*/
@customElement('sbb-tab-group')
export class SbbTabGroupElement extends LitElement {
export class SbbTabGroupElement extends SbbHydrationMixin(LitElement) {
public static override styles: CSSResultGroup = style;
public static readonly events = {
didChange: 'didChange',
Expand Down
3 changes: 2 additions & 1 deletion src/elements/toast/toast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { slotState } from '../core/decorators.js';
import { isFirefox } from '../core/dom.js';
import { composedPathHasAttribute } from '../core/eventing.js';
import { i18nCloseAlert } from '../core/i18n.js';
import { SbbHydrationMixin } from '../core/mixins.js';
import { SbbIconNameMixin } from '../icon.js';
import type { SbbLinkButtonElement, SbbLinkElement, SbbLinkStaticElement } from '../link.js';

Expand Down Expand Up @@ -39,7 +40,7 @@ const toastRefs = new Set<SbbToastElement>();
*/
@customElement('sbb-toast')
@slotState()
export class SbbToastElement extends SbbIconNameMixin(SbbOpenCloseBaseElement) {
export class SbbToastElement extends SbbIconNameMixin(SbbHydrationMixin(SbbOpenCloseBaseElement)) {
public static override styles: CSSResultGroup = style;

/**
Expand Down
Loading