@react-aria/tooltip
Advanced tools
Comparing version 3.0.0-nightly.779 to 3.0.0-nightly.786
@@ -51,3 +51,4 @@ var { | ||
let { | ||
isDisabled | ||
isDisabled, | ||
trigger | ||
} = props; | ||
@@ -90,6 +91,10 @@ let tooltipId = useId(); | ||
let onHoverStart = () => { | ||
// In chrome, if you hover a trigger, then another element obscures it, due to keyboard | ||
if (trigger === 'focus') { | ||
return; | ||
} // In chrome, if you hover a trigger, then another element obscures it, due to keyboard | ||
// interactions for example, hover will end. When hover is restored after that element disappears, | ||
// focus moves on for example, then the tooltip will reopen. We check the modality to know if the hover | ||
// is the result of moving the mouse. | ||
if (getInteractionModality() === 'pointer') { | ||
@@ -105,3 +110,7 @@ isHovered.current = true; | ||
let onHoverEnd = () => { | ||
// no matter how the trigger is left, we should close the tooltip | ||
if (trigger === 'focus') { | ||
return; | ||
} // no matter how the trigger is left, we should close the tooltip | ||
isFocused.current = false; | ||
@@ -108,0 +117,0 @@ isHovered.current = false; |
@@ -27,3 +27,4 @@ import { useFocusable } from "@react-aria/focus"; | ||
let { | ||
isDisabled | ||
isDisabled, | ||
trigger | ||
} = props; | ||
@@ -66,6 +67,10 @@ let tooltipId = useId(); | ||
let onHoverStart = () => { | ||
// In chrome, if you hover a trigger, then another element obscures it, due to keyboard | ||
if (trigger === 'focus') { | ||
return; | ||
} // In chrome, if you hover a trigger, then another element obscures it, due to keyboard | ||
// interactions for example, hover will end. When hover is restored after that element disappears, | ||
// focus moves on for example, then the tooltip will reopen. We check the modality to know if the hover | ||
// is the result of moving the mouse. | ||
if (getInteractionModality() === 'pointer') { | ||
@@ -81,3 +86,7 @@ isHovered.current = true; | ||
let onHoverEnd = () => { | ||
// no matter how the trigger is left, we should close the tooltip | ||
if (trigger === 'focus') { | ||
return; | ||
} // no matter how the trigger is left, we should close the tooltip | ||
isFocused.current = false; | ||
@@ -84,0 +93,0 @@ isHovered.current = false; |
{ | ||
"name": "@react-aria/tooltip", | ||
"version": "3.0.0-nightly.779+d7547a9c", | ||
"version": "3.0.0-nightly.786+d80334eb", | ||
"description": "Spectrum UI components in React", | ||
@@ -21,9 +21,9 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.6.2", | ||
"@react-aria/focus": "3.0.0-nightly.779+d7547a9c", | ||
"@react-aria/interactions": "3.0.0-nightly.779+d7547a9c", | ||
"@react-aria/overlays": "3.0.0-nightly.779+d7547a9c", | ||
"@react-aria/utils": "3.0.0-nightly.779+d7547a9c", | ||
"@react-stately/tooltip": "3.0.1-nightly.2457+d7547a9c", | ||
"@react-types/shared": "3.0.0-nightly.779+d7547a9c", | ||
"@react-types/tooltip": "3.0.1-nightly.2457+d7547a9c" | ||
"@react-aria/focus": "3.0.0-nightly.786+d80334eb", | ||
"@react-aria/interactions": "3.0.0-nightly.786+d80334eb", | ||
"@react-aria/overlays": "3.0.0-nightly.786+d80334eb", | ||
"@react-aria/utils": "3.0.0-nightly.786+d80334eb", | ||
"@react-stately/tooltip": "3.0.1-nightly.2464+d80334eb", | ||
"@react-types/shared": "3.0.0-nightly.786+d80334eb", | ||
"@react-types/tooltip": "3.0.1-nightly.2464+d80334eb" | ||
}, | ||
@@ -36,3 +36,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "d7547a9c2a763b47479883b4893db99f8035ff0d" | ||
"gitHead": "d80334eba4d7a44d282ccbd3736a80708112d0a2" | ||
} |
@@ -40,3 +40,4 @@ /* | ||
let { | ||
isDisabled | ||
isDisabled, | ||
trigger | ||
} = props; | ||
@@ -80,2 +81,5 @@ | ||
let onHoverStart = () => { | ||
if (trigger === 'focus') { | ||
return; | ||
} | ||
// In chrome, if you hover a trigger, then another element obscures it, due to keyboard | ||
@@ -94,2 +98,5 @@ // interactions for example, hover will end. When hover is restored after that element disappears, | ||
let onHoverEnd = () => { | ||
if (trigger === 'focus') { | ||
return; | ||
} | ||
// no matter how the trigger is left, we should close the tooltip | ||
@@ -96,0 +103,0 @@ isFocused.current = false; |
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
47144
477