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) 636 B
import { useCallback as s } from "../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js"; import a from "../useReflex.js"; import { ALREADY_RESOLVED_PROMISE as i } from "../../utils/async/constants.js"; const r = (f) => { const o = s( ((t, e) => { e instanceof Element && e.setAttribute("tabindex", "-1"), t instanceof Element && (t.setAttribute("tabindex", "0"), i.then(() => t?.focus())); }), [] ); return a( s( (t, e) => { try { f?.(t, e); } finally { o(t, e); } }, [f, o] ) ); }; export { r as default };