Skip to content
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

Multiple listbox - deselectOptions util should check for aria-multiselectable #1240

Open
yash49 opened this issue Nov 15, 2024 · 0 comments
Open
Labels
bug Something isn't working needs assessment This needs to be looked at by a team member

Comments

@yash49
Copy link

yash49 commented Nov 15, 2024

Reproduction example

https://codesandbox.io/p/sandbox/musing-panini-c5399j?file=%2Fsrc%2FApp.test.js

Prerequisites

  1. Render a multiple listbox
  2. Select some options
  3. Now deselect option(s) from multiple listbox (using deselectOptions)

Expected behavior

from - https://testing-library.com/docs/user-event/utility/#-selectoptions-deselectoptions

Select/deselect the given options in an HTMLSelectElement or listbox.

I should be able to deselect options from multiple listbox using deselectOptions

https://github.com/testing-library/user-event/blob/main/src/utility/selectOptions.ts#L28

The deselectOptions function is not checking for aria-multiselectable (for multiple listbox)
It does check for multiple though (for multiple select)

Actual behavior

You won't be able to deselct the option(s) from multiple listbox using deselectOptions

User-event version

14.1.1

Environment

The issue is reproducible on codesandbox

I have used the provided codesandbox template

additionally I have used https://mui.com/material-ui/ (mui needs emotion)

"@mui/material": "6.1.7",
"@emotion/styled": "11.13.0",
"@emotion/react": "11.13.3"

Additional context

For more context see this thread on MUI repo

mui/material-ui#44417 (comment)

@yash49 yash49 added bug Something isn't working needs assessment This needs to be looked at by a team member labels Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs assessment This needs to be looked at by a team member
Projects
None yet
Development

No branches or pull requests

1 participant