@codezee/sixtify-brahma 0.2.159 → 0.2.160
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/package.json +1 -1
- package/packages/shared-components/dist/FormFields/Select/Select.js +1 -1
- package/packages/shared-components/dist/utils/hooks/useFormFieldFocus.d.ts +1 -1
- package/packages/shared-components/dist/utils/hooks/useFormFieldFocus.d.ts.map +1 -1
- package/packages/shared-components/dist/utils/hooks/useFormFieldFocus.js +3 -2
package/package.json
CHANGED
|
@@ -207,7 +207,7 @@ function Select({ control, defaultValue, name, required = false, label, multiple
|
|
|
207
207
|
hasPendingChange.current = false;
|
|
208
208
|
setPendingValue(null);
|
|
209
209
|
}
|
|
210
|
-
}, inputRef: setInputRef, onKeyDown: (event) => {
|
|
210
|
+
}, inputRef: (el) => setInputRef(el), onKeyDown: (event) => {
|
|
211
211
|
handleKeyDown(event, () => {
|
|
212
212
|
setOpen(false);
|
|
213
213
|
}, open);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare function useFormFieldFocus(isOpen?: boolean | undefined): {
|
|
2
2
|
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
3
|
-
setInputRef: (ref: HTMLInputElement | null) => void;
|
|
3
|
+
setInputRef: (ref: HTMLDivElement | HTMLInputElement | null) => void;
|
|
4
4
|
maintainFocus: () => void;
|
|
5
5
|
maintainFocusAfterClose: () => void;
|
|
6
6
|
handleKeyDown: <T extends HTMLElement = HTMLElement>(event: React.KeyboardEvent<T>, onClose?: () => void, isPopupOpen?: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormFieldFocus.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/useFormFieldFocus.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS;;
|
|
1
|
+
{"version":3,"file":"useFormFieldFocus.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/useFormFieldFocus.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS;;uBAgHpD,cAAc,GAAG,gBAAgB,GAAG,IAAI;;;oBAhB7C,CAAC,SAAS,WAAW,uBACb,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,YACnB,MAAM,IAAI,gBACN,OAAO;EAsD1B"}
|
|
@@ -9,7 +9,7 @@ function useFormFieldFocus(isOpen) {
|
|
|
9
9
|
const blurTimeoutRef = (0, react_1.useRef)(null);
|
|
10
10
|
const [hasInputElement, setHasInputElement] = (0, react_1.useState)(false);
|
|
11
11
|
(0, react_1.useEffect)(() => {
|
|
12
|
-
const inputElement = inputRef.current;
|
|
12
|
+
const inputElement = inputRef.current instanceof HTMLInputElement ? inputRef.current : null;
|
|
13
13
|
if (!inputElement) {
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
@@ -97,7 +97,8 @@ function useFormFieldFocus(isOpen) {
|
|
|
97
97
|
setHasInputElement(true);
|
|
98
98
|
if (wasFocusedRef.current) {
|
|
99
99
|
requestAnimationFrame(() => {
|
|
100
|
-
if (inputRef.current &&
|
|
100
|
+
if (inputRef.current &&
|
|
101
|
+
document.activeElement !== inputRef.current) {
|
|
101
102
|
inputRef.current.focus();
|
|
102
103
|
}
|
|
103
104
|
});
|