Skip to content

feat: add support for query suggestions on select options #252

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

Merged
merged 2 commits into from
Jul 9, 2020

Conversation

delca85
Copy link
Member

@delca85 delca85 commented Jul 7, 2020

…on element (#237)

What:

Clicking on an option element into a select makes the getByRole 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 a select input to open it, makes the Preview pane rerenders so the click on the option 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 the select element.

Checklist:

-[x] add an onChange listener that in case of this event is performed on a select element calls the selectNode function with the option element as parameter.

  • Tests
  • Ready to be merged

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.

@delca85
Copy link
Member Author

delca85 commented Jul 7, 2020

I remove the getByDisplayValue suggestion in case of the element queried is an option.

@delca85 delca85 changed the title add onChange event listener in order to retrieve info for select opti… support query suggestions for select options Jul 7, 2020
@delca85 delca85 marked this pull request as ready for review July 7, 2020 21:13
Copy link
Member

@smeijer smeijer left a comment

Choose a reason for hiding this comment

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

Thanks! Looking great!

@smeijer smeijer changed the title support query suggestions for select options feat: add support for query suggestions on select options Jul 9, 2020
@smeijer smeijer merged commit ca44599 into develop Jul 9, 2020
@smeijer smeijer deleted the feature/support-query-suggestion-for-select-option branch July 9, 2020 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants