@yamada-ui/use-focus
Advanced tools
Comparing version 1.0.22 to 1.0.23-dev-20241006000212
@@ -9,8 +9,8 @@ import { FocusableElement } from '@yamada-ui/utils'; | ||
} | ||
declare const useFocusOnHide: (containerRef: RefObject<HTMLElement>, { shouldFocus: shouldFocusProp, visible, focusRef }: UseFocusOnHideProps) => void; | ||
declare const useFocusOnHide: (containerRef: RefObject<HTMLElement>, { focusRef, shouldFocus: shouldFocusProp, visible }: UseFocusOnHideProps) => void; | ||
interface UseFocusOnShowProps { | ||
focusRef?: React.RefObject<FocusableElement>; | ||
preventScroll?: boolean; | ||
shouldFocus?: boolean; | ||
visible?: boolean; | ||
shouldFocus?: boolean; | ||
preventScroll?: boolean; | ||
focusRef?: React.RefObject<FocusableElement>; | ||
} | ||
@@ -20,4 +20,4 @@ declare const useFocusOnShow: <T extends HTMLElement>(target: React.RefObject<T> | T, { focusRef, preventScroll, shouldFocus, visible }?: UseFocusOnShowProps) => void; | ||
ref: React.RefObject<HTMLElement>; | ||
elements?: (HTMLElement | null | React.RefObject<HTMLElement>)[]; | ||
enabled?: boolean; | ||
elements?: (React.RefObject<HTMLElement> | HTMLElement | null)[]; | ||
} | ||
@@ -24,0 +24,0 @@ declare const useFocusOnPointerDown: ({ ref, elements, enabled, }: UseFocusOnMouseDownProps) => void; |
@@ -41,3 +41,3 @@ "use client" | ||
}; | ||
var useFocusOnHide = (containerRef, { shouldFocus: shouldFocusProp, visible, focusRef }) => { | ||
var useFocusOnHide = (containerRef, { focusRef, shouldFocus: shouldFocusProp, visible }) => { | ||
const shouldFocus = shouldFocusProp && !visible; | ||
@@ -47,3 +47,3 @@ (0, import_utils.useUpdateEffect)(() => { | ||
if (preventReturnFocus(containerRef)) return; | ||
const el = (focusRef == null ? void 0 : focusRef.current) || containerRef.current; | ||
const el = focusRef.current || containerRef.current; | ||
if (el) { | ||
@@ -82,3 +82,4 @@ requestAnimationFrame(() => { | ||
requestAnimationFrame(() => { | ||
tabbableEls[0].focus({ preventScroll }); | ||
var _a; | ||
(_a = tabbableEls[0]) == null ? void 0 : _a.focus({ preventScroll }); | ||
}); | ||
@@ -85,0 +86,0 @@ } |
{ | ||
"name": "@yamada-ui/use-focus", | ||
"version": "1.0.22", | ||
"version": "1.0.23-dev-20241006000212", | ||
"description": "Yamada UI useFocus custom hook", | ||
@@ -28,4 +28,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@yamada-ui/use-event-listener": "1.0.21", | ||
"@yamada-ui/utils": "1.5.2" | ||
"@yamada-ui/use-event-listener": "1.0.22-dev-20241006000212", | ||
"@yamada-ui/utils": "1.5.3-dev-20241006000212" | ||
}, | ||
@@ -32,0 +32,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25071
242
1
+ Added@yamada-ui/use-event-listener@1.0.22-dev-20241006000212(transitive)
+ Added@yamada-ui/utils@1.5.3-dev-20241006000212(transitive)
- Removed@yamada-ui/use-event-listener@1.0.21(transitive)
- Removed@yamada-ui/utils@1.5.2(transitive)
Updated@yamada-ui/use-event-listener@1.0.22-dev-20241006000212