Skip to content

Commit

Permalink
fix(dialog): added request animation frame before running keyboardTrap (
Browse files Browse the repository at this point in the history
  • Loading branch information
agliga authored Jan 10, 2025
1 parent 9500fd1 commit 06d6ae6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/good-jobs-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ebay/ebayui-core": patch
---

fix(dialog): added request animation frame before running keyboardTrap
3 changes: 2 additions & 1 deletion src/components/components/ebay-dialog-base/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ class DialogBase extends Marko.Component<Input, State> {
if (willTrap) {
screenReaderTrap.trap(this.el, { useHiddenProperty });
if (!useHiddenProperty) {
keyboardTrap.trap(this.windowEl);
// Adding request animation frame because focusables will return that all elements are not visible since dialog is still animating.
requestAnimationFrame(() => keyboardTrap.trap(this.windowEl));
}
}
};
Expand Down

0 comments on commit 06d6ae6

Please sign in to comment.