Skip to content

Commit

Permalink
fix: add option role into allOptions selector (testing-library#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
luistak authored and Jesu Castillo committed Oct 23, 2020
1 parent 4015937 commit c460cc7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/select-options.js
Expand Up @@ -10,7 +10,9 @@ function selectOptionsBase(newValue, select, values, init) {
)
}
const valArray = Array.isArray(values) ? values : [values]
const allOptions = Array.from(select.querySelectorAll('option'))
const allOptions = Array.from(
select.querySelectorAll('option, [role="option"]'),
)
const selectedOptions = valArray
.map(val => {
if (allOptions.includes(val)) {
Expand Down

0 comments on commit c460cc7

Please sign in to comment.