fix: use closest() in Picker to handle clicks on child elements#44
Merged
akaash2512 merged 1 commit intoMay 6, 2026
Merged
Conversation
* and remove the unused import
Contributor
Author
|
Oh, tests failed locally (macOS) because The fix itself is unaffected by this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #43 - a
TypeErroron the script-builder page when clicking items in thePickercomponent that contain child elements (e.g.coral-icon).Problem
The
selectlistChangedclick handler inPicker.tsxcaste.targetdirectly to the list item element. When a child element inside acoral-selectlist-item(such as acoral-icon) is clicked,e.targetresolves to the child rather than the list item itself. This causesitem.valueto beundefined, leading to the following error in the browser console:Solution
Use
.closest('coral-selectlist-item')to traverse up from the actual click target to the nearest list item, regardless of which child element was clicked. If no list item is found (e.g. a click on the container itself), the handler returns early.Changes
src/main/frontend/widgets/Picker.tsx- updatedselectlistChangedto useclosest()instead of a direct cast ofe.targetTesting
0.7.2release as well)./gradlew checkwith-x playwrightpassed