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

PopoverPanel with transition set to true cannot be closed in @headlessui/react v2.1.3 #3437

Closed
lancechentw opened this issue Aug 26, 2024 · 9 comments · Fixed by #3448
Closed
Assignees

Comments

@lancechentw
Copy link

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

v2.1.3, specifically commit 2260422

What browser are you using?

Chrome

Reproduction URL

https://codesandbox.io/p/devbox/currying-brook-9fv9sh

Describe your issue

PopoverPanel with transition set to true cannot be closed, while the one without transition attr works fine.

@Zertz
Copy link
Contributor

Zertz commented Aug 28, 2024

We've had a problem with 2.1.3 that's likely related: a Listbox inside a Dialog can be opened but not interacted with in any way. 2.1.2 worked as expected.

@RobinMalfait
Copy link
Member

Hey sorry about the regression!

This should be fixed by #3448, and will be available in the next release (2.1.4).

You can already try it using:

  • npm install @headlessui/react@insiders.

@mrlubos
Copy link

mrlubos commented Sep 4, 2024

@RobinMalfait not sure what broke in 2.1.3, but I am seeing an issue starting in 2.1.3 and present in 2.1.5 where a click on Combobox/Listbox options does not work. Well, that's not quite accurate, spamming the option item with clicks works, but that's not a typical user behaviour. These options are rendered inside a Transition component if that gives any pointers. Sorry for not having a reproducible example, just wanted to flag this in case you're not aware, 2.1.3 broke quite a few things.

@short-dsb
Copy link

Same as @mrlubos, we’re seeing an issue where it’s not possible to interact with Listbox components that employ a Transition. Everything works as intended in 2.1.2.

@MNeverOff
Copy link

I'm observing similar issues with Transition in @headlessui/react on 2.1.3 and newer (including 2.1.6), for me it mostly manifests as a TypeError: e.getAnimations is not a function in tests, and the functionality itself not working (component doesn't close once the underlying data that it supposed to display is removed from state).

@xsjcTony
Copy link

xsjcTony commented Sep 10, 2024

@MNeverOff Yeah I'm suffering the same issue, looks like they manually poly-filled it in the test😂
https://github.com/tailwindlabs/headlessui/pull/3452/files

@RobinMalfait
Copy link
Member

@MNeverOff @xsjcTony sadly jsdom isn't up to date with newer APIs. We rely on the getAnimations API (which has been available since 2020 in browser) but isn't available in jsdom.

If you use it in tests, I would recommend to polyfill it or an even better solution is to not use jsdom and use real browser based tests using something like Playwright.

I noticed that you (@MNeverOff) commented on #3467 where you ran into similar issues. In the case of that issue it was not working due to conflicting class names which meant that there was no transition happening at all (but the dialog did open/close correctly).

If you run into issue where the component doesn't correctly behave, could you open a new issue with a minimal reproduction repo attached so we can take a look?

@xsjcTony the issue that you are running into is it about the issue you opened or a different one?

@xsjcTony
Copy link

@RobinMalfait My issue is with the test, and I used the polyfill there.

@mrlubos
Copy link

mrlubos commented Oct 1, 2024

@RobinMalfait I can confirm this seems to be resolved in 2.1.8 🎉

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 a pull request may close this issue.

9 participants
@lancechentw @RobinMalfait @Zertz @MNeverOff @mrlubos @xsjcTony @short-dsb and others