UNPKG

@adyen/adyen-platform-experience-web

Version:

![Platform Experience header](https://github.com/Adyen/adyen-platform-experience-web/assets/7926613/18094965-9e01-450e-8dc9-ea84e6b22c2b)

27 lines (26 loc) 628 B
import { useCallback as o } from "../../external/preact/hooks/dist/hooks.module.js"; import i from "../useReflex.js"; import { ALREADY_RESOLVED_PROMISE as m } from "../../utils/async/constants.js"; const A = (f) => { const s = o( (t, e) => { e instanceof Element && e.setAttribute("tabindex", "-1"), t instanceof Element && (t.setAttribute("tabindex", "0"), m.then(() => t == null ? void 0 : t.focus())); }, [] ); return i( o( (t, e) => { try { f == null || f(t, e); } finally { s(t, e); } }, [f] ) ); }; export { A as default };