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][Button] Revert Button loading #44478

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Nov 20, 2024

To add loading to the Button, it's required to wrap the text with another span element to prevent Google translation crash so it's a breaking change.

The work can be revisited in v7.

Revert #42987

@siriwatknp siriwatknp added component: button This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material labels Nov 20, 2024
@mui-bot
Copy link

mui-bot commented Nov 20, 2024

Netlify deploy preview

IconButton: parsed: -4.33% 😍, gzip: -3.45% 😍
Alert: parsed: -3.84% 😍, gzip: -2.94% 😍
Autocomplete: parsed: -2.38% 😍, gzip: -1.78% 😍
@material-ui/core: parsed: -0.58% 😍, gzip: -0.41% 😍
LoadingButton: parsed: +1.16% , gzip: +0.38%
@material-ui/lab: parsed: +0.14% , gzip: -0.02% 😍

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 767a9bc

@zannager zannager requested a review from michaldudak November 20, 2024 11:08
@michaldudak
Copy link
Member

@zannager, since I don't work on Material UI, someone from the Core team might have better insights on the topic.

@michaldudak michaldudak requested review from aarongarciah and removed request for michaldudak November 20, 2024 11:56
Copy link
Member

@aarongarciah aarongarciah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😢

@mnajdova mnajdova merged commit 232555b into mui:master Nov 20, 2024
24 checks passed
siriwatknp added a commit to siriwatknp/material-ui that referenced this pull request Nov 22, 2024
@oliviertassinari
Copy link
Member

oliviertassinari commented Nov 26, 2024

To add loading to the Button, it's required to wrap the text with another span element to prevent Google translation crash so it's a breaking change.

Is this about reverting #26666? It feels a bit like adding bloat, is Google translation + loading important enough?

What if we were to give up on this? #27853 suggests that it's important to fix. But maybe we could leave this as a documentation note? We could ship this now, and wait to see it works. In the docs, we could suggest:

  1. to patch DOM operations Make React resilient to DOM mutations from Google Translate facebook/react#11538 (comment)
  2. or add wrapping span Make React resilient to DOM mutations from Google Translate facebook/react#11538 (comment)
  3. to disable translations: Make React resilient to DOM mutations from Google Translate facebook/react#11538 (comment)

https://martijnhols.nl/gists/everything-about-google-translate-crashing-react is an interesting dive into this problem.

siriwatknp added a commit to siriwatknp/material-ui that referenced this pull request Dec 2, 2024
siriwatknp added a commit to siriwatknp/material-ui that referenced this pull request Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: button This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants