Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hidden component not working correctly when adding an extra breakpoints because of its static props #44734

Closed
maapteh opened this issue Dec 11, 2024 · 3 comments
Assignees
Labels
component: Hidden The React component. out of scope The problem looks valid but we won't fix it (maybe we will revisit it in the future)

Comments

@maapteh
Copy link

maapteh commented Dec 11, 2024

Steps to reproduce

Steps:

  1. I added an extra breakpoint, 2560 and in the theme breakpoints keys this is nicely the last one
    2.Then i used a <Hidden smUp> component with the default JS integration
    3.Suddenly it showed the content when my screen was 3000,

Current behavior

The behaviour in Hidden is based on props, Then for smUp it then finds my screen with 3000 and breakpoint 2560 that for smUp it should be visible instead of hidden.

Screenshot 2024-12-11 at 13 29 37

my values are:
Screenshot 2024-12-11 at 13 33 34

Expected behavior

When i add a breakpoint which is bigger then the value set it should not influence be shown when i asked it to be hidden.

Context

We need extra breakpoints. It works in other MUI components nicely, only with the Hidden components it shows side effects

Your environment

npx @mui/envinfo
  System:
    OS: macOS 15.1.1
  Binaries:
    Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node
    npm: 10.9.0 - ~/.nvm/versions/node/v22.11.0/bin/npm
    pnpm: 8.14.3 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 131.0.6778.139
    Edge: Not Found
    Safari: 18.1.1
  npmPackages:
    @emotion/react: 11.11.4 => 11.11.4
    @emotion/styled: 11.11.5 => 11.11.5
    @mui/lab: 6.0.0-beta.17 => 6.0.0-beta.17
    @mui/material: 6.1.9 => 6.1.9
    @mui/system: 6.1.9 => 6.1.9
    @mui/utils: 6.1.9 => 6.1.9
    @mui/x-data-grid: 7.22.1 => 7.22.1
    @mui/x-data-grid-pro: 7.22.1 => 7.22.1
    @mui/x-date-pickers: 7.20.0 => 7.20.0
    @mui/x-date-pickers-pro: 7.20.0 => 7.20.0
    @mui/x-license: 7.20.0 => 7.20.0
    @types/react: 18.3.12 => 18.3.12
    react: 18.3.1 => 18.3.1
    react-dom: 18.3.1 => 18.3.1
    typescript: 5.6.3 => 5.6.3

Search keywords: Hidden, breakpoint

@maapteh maapteh added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 11, 2024
@maapteh
Copy link
Author

maapteh commented Dec 11, 2024

Ah its deprecated, thats even better! The mediaQuery has indeed no bug :)

@zannager zannager added the component: Hidden The React component. label Dec 11, 2024
@siriwatknp
Copy link
Member

The Hidden with js implementation does not support custom breakpoints and it's deprecated.

@siriwatknp siriwatknp added out of scope The problem looks valid but we won't fix it (maybe we will revisit it in the future) and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Dec 12, 2024
Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@maapteh How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Hidden The React component. out of scope The problem looks valid but we won't fix it (maybe we will revisit it in the future)
Projects
None yet
Development

No branches or pull requests

3 participants