@sanity/ui 1.3.4 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -7997,6 +7997,7 @@ const MenuButton = react.forwardRef(function MenuButton2(props, ref) {
|
|
|
7997
7997
|
id,
|
|
7998
7998
|
menu: menuProp,
|
|
7999
7999
|
onClose,
|
|
8000
|
+
onOpen,
|
|
8000
8001
|
placement: deprecated_placement,
|
|
8001
8002
|
popoverScheme: deprecated_popoverScheme,
|
|
8002
8003
|
portal: deprecated_portal = true,
|
|
@@ -8009,6 +8010,11 @@ const MenuButton = react.forwardRef(function MenuButton2(props, ref) {
|
|
|
8009
8010
|
const [buttonElement, setButtonElement] = react.useState(null);
|
|
8010
8011
|
const [menuElements, setChildMenuElements] = react.useState([]);
|
|
8011
8012
|
const openRef = react.useRef(open);
|
|
8013
|
+
react.useEffect(() => {
|
|
8014
|
+
if (onOpen && open && !openRef.current) {
|
|
8015
|
+
onOpen();
|
|
8016
|
+
}
|
|
8017
|
+
}, [onOpen, open]);
|
|
8012
8018
|
react.useEffect(() => {
|
|
8013
8019
|
if (onClose && !open && openRef.current) {
|
|
8014
8020
|
onClose();
|