Skip to content

Conversation

@matchai
Copy link
Contributor

@matchai matchai commented Oct 12, 2018

What:

Replace the existing select query mechanism which uses HTMLSelectElement .selectedOptions with a query that searches for the selected attribute of an HTMLOptionElement.

Why:

Closes #115.

Since selectedOptions is not a reactive property, JSDOM was not updating to match the selected option in a select Element. The selected attribute is reactive.

How:

Instead of iterating through selectedOptions of an HTMLSelectElement, we iterate through all HTMLSelectOptions and isolate the ones that are selected.

I've gone ahead and tested this locally to make sure that it would be reactive! 👍

Checklist:

  • Documentation N/A
  • Tests N/A
  • Ready to be merged
  • Added myself to contributors table

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

Super! Thank you :)

@kentcdodds kentcdodds merged commit 6ed5eef into testing-library:master Oct 12, 2018
@kentcdodds
Copy link
Member

🎉 This PR is included in version 3.10.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

<select> doesn't reflect new "select text" in response to change event

2 participants