@react-md/menu
Version:
Create menus that auto-position themselves within the viewport and adhere to the accessibility guidelines
14 lines • 521 B
JavaScript
import { useFocusOnMount, usePreviousFocus } from "@react-md/utils";
/**
* This is just a simple component that is used with the `Menu` component to
* handle the initial focus on mount and re-focusing a previous element on
* unmount.
* @private
*/
export function MenuEvents(_a) {
var menuRef = _a.menuRef, cancelled = _a.cancelled, defaultFocus = _a.defaultFocus;
usePreviousFocus(cancelled);
useFocusOnMount(menuRef, defaultFocus, false, true);
return null;
}
//# sourceMappingURL=MenuEvents.js.map