[material-ui][Autocomplete] Fix bug with child chip button events propagating to parent#43982
Conversation
|
i just added one more update. i found another bug introduced by #42494 where if you clicked the autocomplete root component (and not the input) it wouldn't open and close the menu which was a regression as it used to do that. i added another fix to add that behavior back. i'm assuming #42494's use case is still good as well as after applying this new fix (which undid some of their changes) their test they added still passes. it all looks good to me now, but tbh i didn't totally understand what bug they were fixing. |
Netlify deploy previewhttps://deploy-preview-43982--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
|
Thanks for working on this @snapwich, I'm picking this one up, see #43976 (comment). |
|
Tests added for:
Waiting for #43976 (comment) to see if we can come up with a way to test #43976. |
|
@aarongarciah may I ask you to review this? (I don't review it myself as I contributed heavily to it) This PR reverts #42494, but keeps the I added tests for the issue reported in this PR, #44053, and #42432. @cherniavskii if you consider it necessary, we could add a regression test for #43976 that simulates that issue's actions in the |
aarongarciah
left a comment
There was a problem hiding this comment.
Nice! Tested manually and all of the fixes seem to work as expected. The tests also look better now.
|
@DiegoAndai @snapwich Thanks for fixing this and other related issues. |
#42494 introduced a bug where the mouse down events in chips (such as clicking the delete button) was being handled in the autocomplete causing it to open/close as you deleted chips. i put the check back for
if (event.target === event.currentTarget) {and added a test and it seems to fix the issue.