UNPKG

@progress/kendo-react-tooltip

Version:

React Tooltips library represents popups with information that is related to a UI element. KendoReact Tooltips package

30 lines (29 loc) 1.06 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { FOCUSABLE_ELEMENTS as r } from "@progress/kendo-react-common"; const n = (e) => { if (e) { const t = e.querySelectorAll(r.join(", ")); if (t.length) return t[0]; } }, l = (e) => { if (e) { const t = e.querySelectorAll(r.join(", ")); if (t.length) return t[t.length - 1]; } }, c = (e) => { const t = n(document.querySelector(".k-popover-inner")), o = l(document.querySelector(".k-popover-inner")); e.shiftKey && e.target === t ? (o && o.focus(), e.preventDefault()) : !e.shiftKey && e.target === o && (t && t.focus(), e.preventDefault()); }; export { n as getFirstFocusableElement, l as getLastFocusableElement, c as handleFocusTrap };