react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

userEvent.keyboard('{arrowdown}') no longer opens combobox in playwright tests since 12-20 release

Open ashleyryan opened this issue 1 year ago โ€ข 1 comments

Provide a general summary of the issue here

We use Storybook interaction tests and storybook test-runner to run interaction/unit tests against our components. When I updated to the 12.20 release, I noticed that in the test-runner (but not in the browser interaction tests tab, which I don't believe uses Playwright) all of our combobox tests that use userEvent.keyboard('{arrowdown}') or user.type(await canvas.findByRole('combobox'), '{arrowdown}') on the text input to open the popover no longer fire the open event.

Interestingly, the tests where I type letters seem to work fine, it's simulating other keys that doesn't appear to. Are you aware of any changes to key press behavior for overlays that may have broken this?

๐Ÿค” Expected Behavior?

The combobox opens when simulating an arrowdown

๐Ÿ˜ฏ Current Behavior

the combobox does not open simulating an arrow down

๐Ÿ’ Possible Solution

No response

๐Ÿ”ฆ Context

This is a long shot. I looked at the commits in the react-aria/overlays folder in code and didn't see anything obvious that stuck out to me, so hoping you all have an idea of a change that may have caused this between the November and December release. These are the packages we use:

 "@react-aria/button": "3.9.1",
 "@react-aria/combobox": "3.8.1",
 "@react-aria/dialog": "3.5.9",
 "@react-aria/i18n": "3.10.0",
 "@react-aria/interactions": "3.20.1",
 "@react-aria/listbox": "3.11.3",
 "@react-aria/menu": "3.12.0",
 "@react-aria/overlays": "3.20.0", // downgrading yo 3.19.0 will fix the issue
 "@react-aria/separator": "3.3.9",
 "@react-aria/ssr": "3.9.1",
 "@react-stately/collections": "3.10.4",
 "@react-stately/combobox": "3.8.1",
 "@react-stately/data": "3.11.0",
 "@react-stately/list": "3.10.2",
 "@react-stately/menu": "3.6.0",
    "@react-stately/overlays": "3.6.4",

๐Ÿ–ฅ๏ธ Steps to Reproduce

Version

2023-12-20

What browsers are you seeing the problem on?

Other

If other, please specify.

Jest + Playwright

What operating system are you using?

MacOS & Windows

๐Ÿงข Your Company/Team

No response

๐Ÿ•ท Tracking Issue

No response

ashleyryan avatar Feb 01 '24 18:02 ashleyryan

all of our combobox tests that use userEvent.keyboard('{arrowdown}') or user.type(await canvas.findByRole('combobox'), '{arrowdown}') on the text input to open the popover no longer fire the open event

By the above, do you mean you confirmed onOpenChange doesn't fire at all? There was this change to close combobox dropdowns on scroll, wondering if a scroll event could be instantly closing the drop down. Other than that nothing else immediately jumps out to me, would have to dive into the code with a reproduction

LFDanLu avatar Feb 02 '24 01:02 LFDanLu