We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent efc121d commit 4058ab8Copy full SHA for 4058ab8
src/SubMenu/index.tsx
@@ -259,12 +259,10 @@ const InternalSubMenu = (props: SubMenuProps) => {
259
// Cache mode if it change to `inline` which do not have popup motion
260
const triggerModeRef = React.useRef(mode);
261
262
- React.useEffect(() => {
+ if (mode !== 'inline' && connectedPath.length > 1) {
263
+ triggerModeRef.current = 'vertical';
264
+ } else {
265
triggerModeRef.current = mode;
- }, [mode]);
-
266
- if (mode !== 'inline') {
267
- triggerModeRef.current = connectedPath.length > 1 ? 'vertical' : mode;
268
}
269
270
if (!overflowDisabled) {
0 commit comments