Skip to content

[Switch] Add preventDefault check for state change - #23786

Merged
oliviertassinari merged 2 commits into
mui:nextfrom
praveenkumar-kalidass:switch-prevent-default
Nov 30, 2020
Merged

oliviertassinari merged 2 commits into
mui:nextfrom
praveenkumar-kalidass:switch-prevent-default

Conversation

@praveenkumar-kalidass

Copy link
Copy Markdown
Contributor

What does it do?

Checks whether the default behaviour is prevented, if yes, restricts the state change of the checkbox element.

Why is it needed?

preventDefault should restrict the default behaviour of the input element and stop the element from updating.

Related issue(s)/PR(s)
Closes #23709

@mui-pr-bot

mui-pr-bot commented Nov 30, 2020 •

Copy link
Copy Markdown

Details of bundle changes

Generated by 🚫 dangerJS against f0ec66b

@eps1lon eps1lon added type: bug It doesn't behave as expected. scope: switch Changes related to the switch. labels Nov 30, 2020

@eps1lon eps1lon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great test!

@oliviertassinari
oliviertassinari merged commit a89495f into mui:next Nov 30, 2020
@legraphista

Copy link
Copy Markdown

Hi!
Any chance this could be backported to v4?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: switch Changes related to the switch. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Switch] preventDefault is ignored

5 participants