Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@yamada-ui/use-focus

Package Overview
Dependencies
Maintainers
0
Versions
569
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yamada-ui/use-focus - npm Package Compare versions

Comparing version 1.0.22 to 1.0.23-dev-20241006000212

10

dist/index.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc