diff --git a/.changeset/good-jobs-cheat.md b/.changeset/good-jobs-cheat.md new file mode 100644 index 000000000..5912757b7 --- /dev/null +++ b/.changeset/good-jobs-cheat.md @@ -0,0 +1,5 @@ +--- +"@ebay/ebayui-core": patch +--- + +fix(dialog): added request animation frame before running keyboardTrap diff --git a/src/components/components/ebay-dialog-base/component.ts b/src/components/components/ebay-dialog-base/component.ts index a2781506e..02563a943 100644 --- a/src/components/components/ebay-dialog-base/component.ts +++ b/src/components/components/ebay-dialog-base/component.ts @@ -246,7 +246,8 @@ class DialogBase extends Marko.Component { 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)); } } };