-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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][button] Text not vertically centered #43545
Comments
Thank you for your response. To provide more context, I recently started a new project and decided to use MUI v6. While developing the first page, I noticed something off with the I've created a CodeSandbox to demonstrate this issue, and I observed the same result: I mentioned this to a friend, and when he checked on his laptop (MacOS), the button appeared centered, but it remains uncentered on my laptop (Windows 11). |
Hey @sensasi-delight, thanks for the report! I can confirm this behavior on Windows, although I also see it on the latest v5: https://codesandbox.io/p/sandbox/43545-mui-v5-button-preview-8gs5ch?workspaceId=836800c1-9711-491c-a89b-3ac24cbd8cd8. Can you confirm that this sandbox using v5 also shows the issue on your machine? What exact v5 version were you using before migrating to v6? |
Thank you for the response, I'm losing my grip on reality right now. The button texts in all versions appear slightly centered, but still not as perfectly as in v5, which I shared earlier. Additionally, the startIcon in v6, as shown in the documentation, seems slightly lower now. mui version in my previous project is shown below:
|
Here I'm changing back and forth between v5 and v6, confirming there's no difference between versions on my end at least: Screen.Recording.2024-09-05.at.15.01.12.movThat being said, it looks uncentered, so it is a bug (although not a v6-specific one). This issue has been here for a while, and looks like it's the same as: #19584. I'll reopen the original one and add the ready-to-take label. I'm closing this one as a duplicate of #19584, but let me know if you disagree and think it's different. @sensasi-delight In the meantime, I can help you with a workaround. Just share your project or a repro similar to it with me on a comment here. |
Thank you for your response and for offering to help with a workaround. I really appreciate it! However, I’ll be working to resolve the issue on my own for now. Thanks again for reopening the original ticket and for your assistance. Godspeed to you and the entire team! |
Steps to reproduce
Link to live example:
https://mui.com/material-ui/react-button/#buttons-with-icons-and-label
Current behavior
button text is not centered when has a leading/trailing icon
Expected behavior
button text should be vertically centered like v5
Context
No response
Your environment
npx @mui/envinfo
Search keywords: button
The text was updated successfully, but these errors were encountered: