Repository navigation
fix(explore): dispatch NumberControl value on blur to allow field clearing - #37007
Conversation
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Code Review Agent Run #115da0Actionable Suggestions - 0Additional Suggestions - 3
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Nitpicks 🔍
|
|
CodeAnt AI finished reviewing your PR. |
|
🎪 Showtime deployed environment on GHA for ee1331e • Environment: http://54.71.112.33:8080 (admin/admin) |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| onChange={value => onChange?.(parseValue(value))} | ||
| onChange={handleChange} | ||
| onBlur={handleBlur} |
There was a problem hiding this comment.
Hey @rusackas, i saw you looked into the original pr that introduced the previous logic. Do you think the blur is a good compromise here in terms of ux?
SUMMARY
Fixes the issue where users cannot clear the "Number of top values" field in Matrixify to type a new number.
Previously, when deleting digits (e.g., 10 → 1 → empty), the field would snap back to the default value immediately, preventing users from entering a new value.
The root cause was that NumberControl dispatched onChange on every keystroke, which triggered Redux validation. When the field became empty (undefined), the validation logic in
getControlState.tswould reset it to the default value.The fix defers the onChange dispatch to the onBlur event, allowing users to freely edit the field before the value is propagated to Redux.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
top-n-before.mp4
top-n-after.mp4
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION