@jsenv/navi 0.29.321 → 0.29.322
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/jsenv_navi.js +10 -1
- package/dist/dev/jsenv_navi.js.map +2 -2
- package/dist/jsenv_navi.js +10 -1
- package/dist/jsenv_navi.js.map +2 -2
- package/package.json +1 -1
package/dist/dev/jsenv_navi.js
CHANGED
|
@@ -35883,6 +35883,8 @@ const createDisplayedEvent = (ancestor, becauseAncestorOpened) => {
|
|
|
35883
35883
|
* @returns {Function} triggerAutofocus — can be called manually with a synthetic
|
|
35884
35884
|
* event to re-run the focus logic outside of the layout-effect lifecycle.
|
|
35885
35885
|
*/
|
|
35886
|
+
const NO_ELEMENT_REF = { current: null };
|
|
35887
|
+
|
|
35886
35888
|
const useAutoFocus = (
|
|
35887
35889
|
focusableElementRef,
|
|
35888
35890
|
autoFocus,
|
|
@@ -36016,8 +36018,15 @@ const useAutoFocus = (
|
|
|
36016
36018
|
};
|
|
36017
36019
|
};
|
|
36018
36020
|
|
|
36021
|
+
// Nothing to place when the control asks for no focus ("restore" is given
|
|
36022
|
+
// focus by a transfer, never by this effect): the displayed-effect is then
|
|
36023
|
+
// handed no element at all, so it never asks the layout whether one is on
|
|
36024
|
+
// screen — a question every control in a list would otherwise ask at
|
|
36025
|
+
// mount, for an answer this hook would not use. Read at mount, like the
|
|
36026
|
+
// deps below say.
|
|
36027
|
+
const claimsFocus = Boolean(autoFocus) && autoFocus !== "restore";
|
|
36019
36028
|
useDisplayedLayoutEffect(
|
|
36020
|
-
focusableElementRef,
|
|
36029
|
+
claimsFocus ? focusableElementRef : NO_ELEMENT_REF,
|
|
36021
36030
|
(el, e) => {
|
|
36022
36031
|
return triggerAutofocus(e);
|
|
36023
36032
|
},
|