@react-aria/virtualizer
Advanced tools
Comparing version 3.3.4-nightly.2837 to 3.3.4-nightly.2842
@@ -500,12 +500,14 @@ var { | ||
// will have tabIndex={0}. When tabbing in from outside, scroll the focused item into view. | ||
// We only want to do this if the collection itself is receiving focus, not a child | ||
// element, and we aren't moving focus to the collection from within (see below). | ||
if (e.target === ref.current && !isFocusWithin.current) { | ||
virtualizer.scrollToItem(focusedKey, { | ||
duration: 0 | ||
}); | ||
if (!isFocusWithin.current) { | ||
if (scrollToItem) { | ||
scrollToItem(focusedKey); | ||
} else { | ||
virtualizer.scrollToItem(focusedKey, { | ||
duration: 0 | ||
}); | ||
} | ||
} | ||
isFocusWithin.current = e.target !== ref.current; | ||
}, [ref, virtualizer, focusedKey]); | ||
}, [ref, virtualizer, focusedKey, scrollToItem]); | ||
let onBlur = useCallback(e => { | ||
@@ -512,0 +514,0 @@ isFocusWithin.current = ref.current.contains(e.relatedTarget); |
@@ -450,12 +450,14 @@ import { useLocale } from "@react-aria/i18n"; | ||
// will have tabIndex={0}. When tabbing in from outside, scroll the focused item into view. | ||
// We only want to do this if the collection itself is receiving focus, not a child | ||
// element, and we aren't moving focus to the collection from within (see below). | ||
if (e.target === ref.current && !isFocusWithin.current) { | ||
virtualizer.scrollToItem(focusedKey, { | ||
duration: 0 | ||
}); | ||
if (!isFocusWithin.current) { | ||
if (scrollToItem) { | ||
scrollToItem(focusedKey); | ||
} else { | ||
virtualizer.scrollToItem(focusedKey, { | ||
duration: 0 | ||
}); | ||
} | ||
} | ||
isFocusWithin.current = e.target !== ref.current; | ||
}, [ref, virtualizer, focusedKey]); | ||
}, [ref, virtualizer, focusedKey, scrollToItem]); | ||
let onBlur = useCallback(e => { | ||
@@ -462,0 +464,0 @@ isFocusWithin.current = ref.current.contains(e.relatedTarget); |
{ | ||
"name": "@react-aria/virtualizer", | ||
"version": "3.3.4-nightly.2837+ef881eb4f", | ||
"version": "3.3.4-nightly.2842+b5b930fab", | ||
"description": "Spectrum UI components in React", | ||
@@ -21,6 +21,6 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.6.2", | ||
"@react-aria/i18n": "3.0.0-nightly.1152+ef881eb4f", | ||
"@react-aria/utils": "3.0.0-nightly.1152+ef881eb4f", | ||
"@react-stately/virtualizer": "3.1.5-nightly.2837+ef881eb4f", | ||
"@react-types/shared": "3.0.0-nightly.1152+ef881eb4f" | ||
"@react-aria/i18n": "3.0.0-nightly.1157+b5b930fab", | ||
"@react-aria/utils": "3.0.0-nightly.1157+b5b930fab", | ||
"@react-stately/virtualizer": "3.1.5-nightly.2842+b5b930fab", | ||
"@react-types/shared": "3.0.0-nightly.1157+b5b930fab" | ||
}, | ||
@@ -34,3 +34,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "ef881eb4fc24d584580a006810d8b8cba9d196ac" | ||
"gitHead": "b5b930fab4e7b61ab227a749ac00749a77a18ec8" | ||
} |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
1526
146357