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

[material-ui][Card] Cards with a Button as a child element may not position the Button correctly when transitioning in Safari #39138

Closed
2 tasks done
asaxeye opened this issue Sep 24, 2023 · 1 comment
Assignees
Labels
browser: Safari component: card This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material

Comments

@asaxeye
Copy link

asaxeye commented Sep 24, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example:
https://codesandbox.io/p/sandbox/sharp-wilbur-w2yh5z?file=%2Fsrc%2FApp.tsx%3A16%2C27

Steps:

  1. Access the above link in safari
  2. Click the EXPAND button on one of the cards

Current behavior 😯

When the height of the Card changes, the position of the card below it changes, but the Button in the card does not follow it until the transition is complete.
This causes the contents and buttons to overlap.

Expected behavior 🤔

Button should transition as well as Card transition.

Context 🔦

  • This does not occur if the Card is not inside a scrollable element (removing the Box's sx props in App.tsx works fine).
  • Collapse is used in this example, but Conditional Rendering reproduces it as well.
  • It occurred only in safari and was not reproduced in Chrome.

Your environment 🌎

npx @mui/envinfo
  System:
    OS: macOS 13.4.1
  Binaries:
    Node: 20.7.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 10.1.0 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 116.0.5845.187
    Edge: Not Found
    Safari: 16.5.2
  npmPackages:
    @emotion/react: ^11.11.1 => 11.11.1 
    @emotion/styled: ^11.11.0 => 11.11.0 
    @mui/base:  5.0.0-beta.16 
    @mui/core-downloads-tracker:  5.14.10 
    @mui/icons-material: ^5.14.9 => 5.14.9 
    @mui/material: ^5.14.10 => 5.14.10 
    @mui/private-theming:  5.14.10 
    @mui/styled-engine:  5.14.10 
    @mui/system:  5.14.10 
    @mui/types:  7.2.4 
    @mui/utils:  5.14.10 
    @types/react: ^18.2.22 => 18.2.22 
    react: ^18.2.0 => 18.2.0 
    react-dom: ^18.2.0 => 18.2.0 
    typescript: ^5.0.2 => 5.2.2
@asaxeye asaxeye added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 24, 2023
@asaxeye asaxeye changed the title [Card]Button position is incorrect when the height of the Card changes in a scrollable element in safari [Card][material-ui]Cards with a Button as a child element may not position the Button correctly when transitioning Sep 24, 2023
@zannager zannager added the component: card This is the name of the generic UI component, not the React module! label Sep 25, 2023
@samuelsycamore samuelsycamore changed the title [Card][material-ui]Cards with a Button as a child element may not position the Button correctly when transitioning [material-ui][Card] Cards with a Button as a child element may not position the Button correctly when transitioning Oct 10, 2023
@DiegoAndai DiegoAndai changed the title [material-ui][Card] Cards with a Button as a child element may not position the Button correctly when transitioning [material-ui][Card] Cards with a Button as a child element may not position the Button correctly when transitioning in Safari Nov 29, 2023
@DiegoAndai
Copy link
Member

DiegoAndai commented Nov 29, 2023

Hey @asaxeye, thanks for the report! Sorry for the delay.

This seems to be a Safari bug: https://stackoverflow.com/questions/34726992/ios-safari-rendering-bug-when-transitioning-from-overflowhidden

Adding position: fixed and top: 0 to the Box component fixes it: https://codesandbox.io/p/devbox/39138-workaround-f3jtxd

Feel free to reopen if this doesn't fix it for you.

@DiegoAndai DiegoAndai removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 29, 2023
@DiegoAndai DiegoAndai assigned DiegoAndai and unassigned siriwatknp Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser: Safari component: card This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material
Projects
None yet
Development

No branches or pull requests

5 participants