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

[data-grid] Fix crashing of demos on rating change #12315

Merged
merged 2 commits into from
Mar 5, 2024
Merged

[data-grid] Fix crashing of demos on rating change #12315

merged 2 commits into from
Mar 5, 2024

Conversation

sai6855
Copy link
Contributor

@sai6855 sai6855 commented Mar 4, 2024

fixes 2nd bug mentioned in this comment #12199 (comment)

PR for 1st point --> #12335

preview: https://deploy-preview-12315--material-ui-x.netlify.app/x/react-data-grid/filtering/quick-filter/

@sai6855 sai6855 marked this pull request as draft March 4, 2024 11:21
@sai6855 sai6855 added bug 🐛 Something doesn't work docs Improvements or additions to the documentation component: data grid This is the name of the generic UI component, not the React module! labels Mar 4, 2024
@sai6855 sai6855 changed the title fix-rating-focus [data-grid] Fix crashing of demos on rating change Mar 4, 2024
@mui-bot
Copy link

mui-bot commented Mar 4, 2024

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

Generated by 🚫 dangerJS against 8405ddf

Comment on lines 18 to 22
if (value !== 0) {
element.querySelector<HTMLElement>(`input[value="${value}"]`)!.focus();
} else {
element.querySelector<HTMLElement>(`input[value=""]`)!.focus();
}
Copy link
Contributor Author

@sai6855 sai6855 Mar 4, 2024

Choose a reason for hiding this comment

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

when ever user goes one up on 5 and down on 1, value will be 0.
As there are no inputs with value="0" demos were crashing on focusing non existing inputs. So focusing on input with no value (input[value='']) whenever value=0 seems to fix the issue.

@sai6855 sai6855 marked this pull request as ready for review March 4, 2024 11:53
@sai6855 sai6855 requested review from michelengelen and romgrk March 4, 2024 11:54
@romgrk romgrk merged commit 4632c87 into mui:next Mar 5, 2024
17 checks passed
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: data grid This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants