feat: add support for query suggestions on select options #252
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.
…on element (#237)
What:
Clicking on an
option
element into aselect
makes thegetByRole
query to be properly suggested.This works only when
auto-run code
mode is disabled. I think this happens because when the code is automatically executed, clicking on aselect
input to open it, makes thePreview
pane rerenders so the click on theoption
is missed.Why:
In order to provide to the user a better experience.
How:
Before these changes it wasn't possible to obtain the right query clicking on an
option
element because no mouse or pointer event is related to this kind of element.So I added an event listener on the
onChange
event on theselect
element.Checklist:
-[x] add an
onChange
listener that in case of this event is performed on aselect
element calls theselectNode
function with theoption
element as parameter.I just noticed that the playground is providing the wrong information related to the
getByDisplayValue
query so I am going to fix it before changing this PR from draft to something ready to be merged.