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

[fields] Prevent keyboard editing when disabled #13900

Merged

Conversation

arthurbalduini
Copy link
Member

Closes #13387

@mui-bot
Copy link

mui-bot commented Jul 19, 2024

Deploy preview: https://deploy-preview-13900--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 1806b01

@DanailH DanailH changed the title Prevents disabled field editing [pickers] Prevents disabled field editing Jul 19, 2024
@DanailH DanailH added bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! labels Jul 19, 2024
@LukasTy LukasTy changed the title [pickers] Prevents disabled field editing [fields] Prevent keyboard editing when disabled Jul 19, 2024
@LukasTy LukasTy added the feature: Keyboard editing Related to the pickers keyboard edition label Jul 19, 2024
Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

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

Great job! 👏
Thanks for taking care of it. 🙏
Could you add at least a few tests for v7 fields (with enableAccessibleFieldDOMStructure) keyboard editing when disabled? 🙏
Source: #13387 (comment)

@arthurbalduini arthurbalduini force-pushed the prevents-disabled-field-editing branch from a8c30aa to e27abf6 Compare July 19, 2024 13:04
@@ -744,6 +744,63 @@ describe('<DateField /> - Editing', () => {
});
});

describeAdapters('Disabled field', DateField, ({ renderWithProps }) => {
Copy link
Member Author

@arthurbalduini arthurbalduini Jul 19, 2024

Choose a reason for hiding this comment

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

Do you see a good reason to implement similar tests for TimeField ?
Or maybe test it elsewhere?

Copy link
Member

Choose a reason for hiding this comment

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

Good point, I agree, there is no need to duplicate the tests on other regular Field components. 👍

@flaviendelangle flaviendelangle requested a review from LukasTy July 22, 2024 07:32
Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

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

LGTM! 👍
Great job! 💯 🚀

@@ -744,6 +744,63 @@ describe('<DateField /> - Editing', () => {
});
});

describeAdapters('Disabled field', DateField, ({ renderWithProps }) => {
Copy link
Member

Choose a reason for hiding this comment

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

Good point, I agree, there is no need to duplicate the tests on other regular Field components. 👍

@arthurbalduini arthurbalduini merged commit a26c904 into mui:master Jul 22, 2024
17 checks passed
DungTiger pushed a commit to DungTiger/mui-x that referenced this pull request Jul 23, 2024
thomasmoon pushed a commit to thomasmoon/mui-x that referenced this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! feature: Keyboard editing Related to the pickers keyboard edition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[fields] Arrow editing is allowed on a disabled field with enableAccessibleFieldDOMStructure property
4 participants