Skip to content

Commit

Permalink
fix: review
Browse files Browse the repository at this point in the history
  • Loading branch information
jeripeierSBB committed Dec 18, 2024
1 parent 3c375df commit f01db78
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/elements/autocomplete/autocomplete-base-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@ export abstract class SbbAutocompleteBaseElement extends SbbNegativeMixin(
document.addEventListener('scroll', () => this._setOverlayPosition(), {
passive: true,
signal: this._openPanelEventsController.signal,
// Without capture, other scroll contexts would not bubble to this event listener.
// Capture allows us to react to all scroll contexts in this DOM.
capture: true,
});
window.addEventListener('resize', () => this._setOverlayPosition(), {
Expand Down
2 changes: 2 additions & 0 deletions src/elements/menu/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ class SbbMenuElement extends SbbNamedSlotListMixin<
document.addEventListener('scroll', () => this._setMenuPosition(), {
passive: true,
signal: this._windowEventsController.signal,
// Without capture, other scroll contexts would not bubble to this event listener.
// Capture allows us to react to all scroll contexts in this DOM.
capture: true,
});
window.addEventListener('resize', () => this._setMenuPosition(), {
Expand Down
2 changes: 2 additions & 0 deletions src/elements/popover/popover/popover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ class SbbPopoverElement extends SbbHydrationMixin(SbbOpenCloseBaseElement) {
document.addEventListener('scroll', () => this._setPopoverPosition(), {
passive: true,
signal: this._openStateController.signal,
// Without capture, other scroll contexts would not bubble to this event listener.
// Capture allows us to react to all scroll contexts in this DOM.
capture: true,
});
window.addEventListener('resize', () => this._setPopoverPosition(), {
Expand Down
2 changes: 2 additions & 0 deletions src/elements/select/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,8 @@ class SbbSelectElement extends SbbUpdateSchedulerMixin(
document.addEventListener('scroll', () => this._setOverlayPosition(), {
passive: true,
signal: this._openPanelEventsController.signal,
// Without capture, other scroll contexts would not bubble to this event listener.
// Capture allows us to react to all scroll contexts in this DOM.
capture: true,
});
window.addEventListener('resize', () => this._setOverlayPosition(), {
Expand Down

0 comments on commit f01db78

Please sign in to comment.