@zag-js/focus-visible
Advanced tools
Comparing version 0.71.0 to 0.72.0
@@ -15,8 +15,6 @@ 'use strict'; | ||
function isKeyboardFocusEvent(isTextInput, modality, e) { | ||
const IHTMLInputElement = typeof window !== "undefined" ? domQuery.getWindow(e?.target).HTMLInputElement : HTMLInputElement; | ||
const IHTMLTextAreaElement = typeof window !== "undefined" ? domQuery.getWindow(e?.target).HTMLTextAreaElement : HTMLTextAreaElement; | ||
const IHTMLElement = typeof window !== "undefined" ? domQuery.getWindow(e?.target).HTMLElement : HTMLElement; | ||
const IKeyboardEvent = typeof window !== "undefined" ? domQuery.getWindow(e?.target).KeyboardEvent : KeyboardEvent; | ||
isTextInput = isTextInput || e?.target instanceof IHTMLInputElement && !nonTextInputTypes.has(e?.target?.type) || e?.target instanceof IHTMLTextAreaElement || e?.target instanceof IHTMLElement && e?.target.isContentEditable; | ||
return !(isTextInput && modality === "keyboard" && e instanceof IKeyboardEvent && !Reflect.has(FOCUS_VISIBLE_INPUT_KEYS, e.key)); | ||
const target = e ? domQuery.getEventTarget(e) : null; | ||
const win = domQuery.getWindow(target); | ||
isTextInput = isTextInput || target instanceof win.HTMLInputElement && !nonTextInputTypes.has(target?.type) || target instanceof win.HTMLTextAreaElement || target instanceof win.HTMLElement && target.isContentEditable; | ||
return !(isTextInput && modality === "keyboard" && e instanceof win.KeyboardEvent && !Reflect.has(FOCUS_VISIBLE_INPUT_KEYS, e.key)); | ||
} | ||
@@ -58,3 +56,4 @@ var currentModality = null; | ||
function handleFocusEvent(e) { | ||
if (e.target === domQuery.getWindow(e.target) || e.target === domQuery.getDocument(e.target)) { | ||
const target = domQuery.getEventTarget(e); | ||
if (target === domQuery.getWindow(target) || target === domQuery.getDocument(target)) { | ||
return; | ||
@@ -61,0 +60,0 @@ } |
{ | ||
"name": "@zag-js/focus-visible", | ||
"version": "0.71.0", | ||
"version": "0.72.0", | ||
"description": "Focus visible polyfill utility based on WICG", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/dom-query": "0.71.0" | ||
"@zag-js/dom-query": "0.72.0" | ||
}, | ||
@@ -31,0 +31,0 @@ "devDependencies": { |
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
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
18560
362
+ Added@zag-js/dom-query@0.72.0(transitive)
- Removed@zag-js/dom-query@0.71.0(transitive)
Updated@zag-js/dom-query@0.72.0