yousoph commented on code in PR #40781:
URL: https://github.com/apache/superset/pull/40781#discussion_r3599435525


##########
superset-frontend/src/features/home/Menu.tsx:
##########
@@ -199,6 +199,9 @@ export function Menu({
   isFrontendRoute = () => false,
 }: MenuProps) {
   const screens = useBreakpoint();
+  // screens.md is undefined on the first render before breakpoints are 
measured;
+  // treat undefined as true so the nav renders horizontal instead of flashing 
to inline
+  const isMd = screens.md !== false;

Review Comment:
   Good catch — addressed in 22e22feece. When breakpoints are unmeasured, 
`isMd` falls back to `window.innerWidth >= theme.screenMDMin` (the same 
threshold as antd's `md` media query) instead of defaulting to desktop, so the 
first paint matches the device layout on both desktop and mobile. Added a 
regression test covering the narrow-viewport unmeasured case.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to