material-ui-popup-state
Advanced tools
Comparing version 1.9.1 to 1.9.2
25
core.js
@@ -47,2 +47,3 @@ "use strict"; | ||
hovered: false, | ||
focused: false, | ||
_childPopupState: null, | ||
@@ -65,2 +66,3 @@ _deferNextOpen: false, | ||
hovered = state.hovered, | ||
focused = state.focused, | ||
_childPopupState = state._childPopupState, | ||
@@ -114,3 +116,4 @@ _deferNextOpen = state._deferNextOpen, | ||
isOpen: true, | ||
hovered: eventType === 'mouseover' | ||
hovered: eventType === 'mouseover', | ||
focused: eventType === 'focus' | ||
}; | ||
@@ -142,7 +145,12 @@ | ||
if (eventType === 'touchstart') { | ||
setState({ | ||
_deferNextClose: true | ||
}); | ||
return; | ||
switch (eventType) { | ||
case 'touchstart': | ||
setState({ | ||
_deferNextClose: true | ||
}); | ||
return; | ||
case 'blur': | ||
if (isElementInPopup(arg === null || arg === void 0 ? void 0 : arg.relatedTarget, popupState)) return; | ||
break; | ||
} | ||
@@ -155,3 +163,4 @@ | ||
isOpen: false, | ||
hovered: false | ||
hovered: false, | ||
focused: false | ||
}); | ||
@@ -202,3 +211,3 @@ }; | ||
onMouseLeave: onMouseLeave, | ||
disableAutoFocus: Boolean(disableAutoFocus), | ||
disableAutoFocus: disableAutoFocus !== null && disableAutoFocus !== void 0 ? disableAutoFocus : Boolean(hovered || focused), | ||
_childPopupState: _childPopupState, | ||
@@ -205,0 +214,0 @@ _setChildPopupState: _setChildPopupState |
@@ -38,2 +38,3 @@ "use strict"; | ||
hovered: false, | ||
focused: false, | ||
_childPopupState: null, | ||
@@ -58,2 +59,3 @@ _deferNextOpen: false, | ||
hovered, | ||
focused, | ||
_childPopupState, | ||
@@ -110,3 +112,4 @@ _deferNextOpen, | ||
isOpen: true, | ||
hovered: eventType === 'mouseover' | ||
hovered: eventType === 'mouseover', | ||
focused: eventType === 'focus' | ||
}; | ||
@@ -138,7 +141,12 @@ | ||
if (eventType === 'touchstart') { | ||
setState({ | ||
_deferNextClose: true | ||
}); | ||
return; | ||
switch (eventType) { | ||
case 'touchstart': | ||
setState({ | ||
_deferNextClose: true | ||
}); | ||
return; | ||
case 'blur': | ||
if (isElementInPopup(arg === null || arg === void 0 ? void 0 : arg.relatedTarget, popupState)) return; | ||
break; | ||
} | ||
@@ -151,3 +159,4 @@ | ||
isOpen: false, | ||
hovered: false | ||
hovered: false, | ||
focused: false | ||
}); | ||
@@ -196,3 +205,3 @@ }; | ||
onMouseLeave, | ||
disableAutoFocus: Boolean(disableAutoFocus), | ||
disableAutoFocus: disableAutoFocus !== null && disableAutoFocus !== void 0 ? disableAutoFocus : Boolean(hovered || focused), | ||
_childPopupState, | ||
@@ -199,0 +208,0 @@ _setChildPopupState |
{ | ||
"name": "material-ui-popup-state", | ||
"version": "1.9.1", | ||
"version": "1.9.2", | ||
"description": "easiest way to create menus, popovers, and poppers with material-ui", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -277,4 +277,3 @@ # material-ui-popup-state | ||
You should use this option if you are doing `bindHover`. Otherwise the document may scroll back to the previous focused | ||
element when you move the pointer out of the hovered menu or popover. | ||
Defaults to `true` when the popup is opened by the `bindHover` or `bindFocus` element. | ||
@@ -398,3 +397,3 @@ ## `usePopupState` return value | ||
const HoverPopoverPopupState = ({ classes }) => ( | ||
<PopupState variant="popover" popupId="demoPopover" disableAutoFocus> | ||
<PopupState variant="popover" popupId="demoPopover"> | ||
{(popupState) => ( | ||
@@ -552,3 +551,3 @@ <div> | ||
You should use this option if you are doing `bindHover`. Otherwise the document may scroll back to the previous focused | ||
Defaults to `true` when the popup is opened by the `bindHover` or `bindFocus` element. | ||
@@ -555,0 +554,0 @@ ### `children` (`(popupState: InjectedProps) => ?React.Node`, **required**) |
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
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
134385
1973
579