fix(modal): prevent fullscreen prop override#1618
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Modal component to destructure props and exclude fullScreen and fullWidth into restProps, which is now spread at the beginning of StyledDialog to prevent overriding internal properties. The reviewer suggested formatting the destructuring assignment on a single line to fix inconsistent indentation and improve readability.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Signed-off-by: Salmaan-M <133296753+Salmaan-M@users.noreply.github.com>
9b33bb7 to
eacae5a
Compare
|
@Salmaan-M, any type of Loom recording demonstrating your changes would help us understand what you fixed and what the current behavior is. |
lv_0_20260608225642.mp4This video demonstrates how prop reordering helps in fixing the [UI] Full screen issue @saurabhraghuvanshii |
|
Thanks @Salmaan-M lgtm!! |
|
learned new thing today from you. |
what is it? 🙂 @saurabhraghuvanshii |
secret!! |
Come on yaarr? make me happy |
banana-three-join
left a comment
There was a problem hiding this comment.
What happens if you don't ignore the fullwidth? Can you still open and close the modal? Because I believe the prop that is overriding the internal fullscreen serves as the initial state for whether the fullscreen should be open or closed on the first interation and then, the fullscreen state is handled by the component itself. This means that by ignoring the initial fullscreen prop, we might have a modal to start on fullscreen by default but since we are ignoring it, we can never have that initial state. (Which if that's the case, it's not stated in the prop type for the modal anyways so that would also need to be fixed)
|
That's a very good point. During debugging, what I observed was that the issue occurred because external My intention with filtering const [fullScreen, setFullScreen] = useState(false);However, you're right that this also removes the possibility of consumers intentionally providing an initial fullscreen state through props. I agree that there are really two separate concerns here:
If supporting an initial fullscreen state is desirable behavior, then a better approach may be:
Something like: const [fullScreen, setFullScreen] = useState(props.fullScreen ?? false);while still preventing later prop precedence conflicts. I think this approach better preserves the initial-state capability while still addressing the runtime override issue that caused the fullscreen toggle bug. I'll prototype this approach and validate the behavior locally. What's your say @banana-three-join |
|
@Salmaan-M yeah the idea seems about right but maybe the variable should have a more descriptive name like openFullscreenOnStart={boolean} instead of fullscreen In regards of the desired behavior, that would be my best guest since as I mentioned earlier, the typing of the modal itself lacks a fullscreen prop. I would say that the prop also needs to be added to the typing so it's usage is a little bit clearer since at the end of the day, it has it's own internal state to manage whether the modal is in fullscreen mode or not |
|
@banana-three-join That makes sense to me. Using a more explicit prop like I also agree that the typing/API should make this behavior explicit instead of implicitly inheriting it through I'll prototype this approach locally and validate the behavior in Meshery as well. |
|
@Salmaan-M, how's the progress on the issue? |
|
I prototyped an |
|
Yep, go ahead and make the change @Salmaan-M |
|
@Salmaan-M Are you working on fixing this issue? |
|
@KhushamBansal yes, I am working on it. |
Notes for Reviewers
Description
This PR fixes an issue where the Modal component's internal fullscreen state could be overridden by external props.
Previously:
allowed consumers passing fullScreen or fullWidth props to override the internal fullscreen toggle state managed by the component itself.
This caused fullscreen toggle behavior to fail in downstream consumers such as Meshery's Registry modal.
Changes Made
Filtered conflicting fullScreen and fullWidth props from external props
Preserved external overrides for unrelated props
Kept internal fullscreen state authoritative
Testing
Verified fullscreen toggle works correctly locally
Verified dialog now receives MuiDialog-paperFullScreen
Confirmed no unintended changes to unrelated props
Signed commits
This PR fixes #1617
Signed commits