@react-aria/virtualizer
Advanced tools
Comparing version 3.3.5-nightly.2978 to 3.3.5-nightly.2985
@@ -27,2 +27,6 @@ var { | ||
var { | ||
getInteractionModality | ||
} = require("@react-aria/interactions"); | ||
var { | ||
focusWithoutScrolling, | ||
@@ -382,3 +386,3 @@ mergeProps, | ||
position: layoutInfo.isSticky ? 'sticky' : 'absolute', | ||
overflow: 'hidden', | ||
overflow: layoutInfo.allowOverflow ? 'visible' : 'hidden', | ||
top: layoutInfo.rect.y - (parent ? parent.rect.y : 0), | ||
@@ -395,3 +399,3 @@ [xProperty]: layoutInfo.rect.x - (parent ? parent.rect.x : 0), | ||
transform: layoutInfo.transform, | ||
contain: 'size layout style paint' | ||
contain: layoutInfo.allowOverflow ? 'size layout style' : 'size layout style paint' | ||
}; | ||
@@ -416,3 +420,3 @@ $bf262162425aa7028ff507f81a78147$var$cache.set(layoutInfo, style); | ||
} = props, | ||
otherProps = _babelRuntimeHelpersObjectWithoutPropertiesLoose(props, ["children", "renderWrapper", "layout", "collection", "sizeToFit", "scrollDirection", "transitionDuration", "isLoading", "onLoadMore", "focusedKey", "shouldUseVirtualFocus"]); | ||
otherProps = _babelRuntimeHelpersObjectWithoutPropertiesLoose(props, ["children", "renderWrapper", "layout", "collection", "sizeToFit", "scrollDirection", "transitionDuration", "isLoading", "onLoadMore", "focusedKey", "shouldUseVirtualFocus", "scrollToItem"]); | ||
@@ -488,3 +492,5 @@ let fallbackRef = useRef(); | ||
if (focusedKey !== lastFocusedKey.current) { | ||
let modality = getInteractionModality(); | ||
if (focusedKey !== lastFocusedKey.current && modality !== 'pointer') { | ||
if (scrollToItem) { | ||
@@ -505,3 +511,4 @@ scrollToItem(focusedKey); | ||
// will have tabIndex={0}. When tabbing in from outside, scroll the focused item into view. | ||
if (!isFocusWithin.current) { | ||
// Ignore focus events that bubble through portals (e.g. focus that happens on a menu popover child of the virtualizer) | ||
if (!isFocusWithin.current && ref.current.contains(e.target)) { | ||
if (scrollToItem) { | ||
@@ -508,0 +515,0 @@ scrollToItem(focusedKey); |
@@ -5,2 +5,3 @@ import { useLocale } from "@react-aria/i18n"; | ||
import { useVirtualizerState, Rect, Size } from "@react-stately/virtualizer"; | ||
import { getInteractionModality } from "@react-aria/interactions"; | ||
import { focusWithoutScrolling, mergeProps, useLayoutEffect, useResizeObserver } from "@react-aria/utils"; | ||
@@ -334,3 +335,3 @@ import _babelRuntimeHelpersEsmObjectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
position: layoutInfo.isSticky ? 'sticky' : 'absolute', | ||
overflow: 'hidden', | ||
overflow: layoutInfo.allowOverflow ? 'visible' : 'hidden', | ||
top: layoutInfo.rect.y - (parent ? parent.rect.y : 0), | ||
@@ -347,3 +348,3 @@ [xProperty]: layoutInfo.rect.x - (parent ? parent.rect.x : 0), | ||
transform: layoutInfo.transform, | ||
contain: 'size layout style paint' | ||
contain: layoutInfo.allowOverflow ? 'size layout style' : 'size layout style paint' | ||
}; | ||
@@ -366,3 +367,3 @@ $e09852aaf18d180234f78ea6d834637e$var$cache.set(layoutInfo, style); | ||
} = props, | ||
otherProps = _babelRuntimeHelpersEsmObjectWithoutPropertiesLoose(props, ["children", "renderWrapper", "layout", "collection", "sizeToFit", "scrollDirection", "transitionDuration", "isLoading", "onLoadMore", "focusedKey", "shouldUseVirtualFocus"]); | ||
otherProps = _babelRuntimeHelpersEsmObjectWithoutPropertiesLoose(props, ["children", "renderWrapper", "layout", "collection", "sizeToFit", "scrollDirection", "transitionDuration", "isLoading", "onLoadMore", "focusedKey", "shouldUseVirtualFocus", "scrollToItem"]); | ||
@@ -438,3 +439,5 @@ let fallbackRef = useRef(); | ||
if (focusedKey !== lastFocusedKey.current) { | ||
let modality = getInteractionModality(); | ||
if (focusedKey !== lastFocusedKey.current && modality !== 'pointer') { | ||
if (scrollToItem) { | ||
@@ -455,3 +458,4 @@ scrollToItem(focusedKey); | ||
// will have tabIndex={0}. When tabbing in from outside, scroll the focused item into view. | ||
if (!isFocusWithin.current) { | ||
// Ignore focus events that bubble through portals (e.g. focus that happens on a menu popover child of the virtualizer) | ||
if (!isFocusWithin.current && ref.current.contains(e.target)) { | ||
if (scrollToItem) { | ||
@@ -458,0 +462,0 @@ scrollToItem(focusedKey); |
@@ -45,2 +45,3 @@ import { Direction, Collection } from "@react-types/shared"; | ||
shouldUseVirtualFocus?: boolean; | ||
scrollToItem?: (key: Key) => void; | ||
} | ||
@@ -47,0 +48,0 @@ interface VirtualizerOptions { |
{ | ||
"name": "@react-aria/virtualizer", | ||
"version": "3.3.5-nightly.2978+2e8faba3c", | ||
"version": "3.3.5-nightly.2985+1f99ba27d", | ||
"description": "Spectrum UI components in React", | ||
@@ -21,6 +21,7 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.6.2", | ||
"@react-aria/i18n": "3.0.0-nightly.1292+2e8faba3c", | ||
"@react-aria/utils": "3.0.0-nightly.1292+2e8faba3c", | ||
"@react-stately/virtualizer": "3.1.6-nightly.2978+2e8faba3c", | ||
"@react-types/shared": "3.0.0-nightly.1292+2e8faba3c" | ||
"@react-aria/i18n": "3.0.0-nightly.1299+1f99ba27d", | ||
"@react-aria/interactions": "3.0.0-nightly.1299+1f99ba27d", | ||
"@react-aria/utils": "3.0.0-nightly.1299+1f99ba27d", | ||
"@react-stately/virtualizer": "3.1.6-nightly.2985+1f99ba27d", | ||
"@react-types/shared": "3.0.0-nightly.1299+1f99ba27d" | ||
}, | ||
@@ -34,3 +35,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "2e8faba3c880b8ffcdde4790207cc65db8522c7a" | ||
"gitHead": "1f99ba27d9144d0f79e514f18ff1f3ef85958ab3" | ||
} |
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
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
149631
1541
8