Skip to content

Conversation

RobinMalfait
Copy link
Member

No description provided.

RobinMalfait and others added 2 commits August 2, 2021 13:57
* add `{type:'button'}` only for buttons

We will try and infer the type based on the passed in `props.as` prop or
the default tag. However, when somebody uses `as={CustomComponent}` then
we don't know what it will render. Therefore we have to pass it a ref
and check if the final result is a button or not. If it is, and it
doesn't have a `type` yet, then we can set the `type` correctly.

* update changelog
* Add Vue emit types

* ensure value is a boolean

Even though we only use `false` for now

* add Vue emit types for Tabs component

* update changelog

Co-authored-by: henribru <6639509+henribru@users.noreply.github.com>
@vercel
Copy link

vercel bot commented Aug 2, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

headlessui-react – ./packages/@headlessui-react

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-react/H3S1PaWrqYgkt1HnDMGGxxMNFFV2
✅ Preview: https://headlessui-react-git-develop-tailwindlabs.vercel.app

headlessui-vue – ./packages/@headlessui-vue

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-vue/ANLdwGE6dhKZe8RAPa3oeXb36HVz
✅ Preview: https://headlessui-vue-git-develop-tailwindlabs.vercel.app

* fix broken `escape` key behaviour

We've "fixed" an issue when we had nested Dialogs ([#430](#430)).
The `escape` would not close the correct Dialog. The issue here was with
the logic to know whether we were the last Dialog or not. The issue was
_not_ how we implemented the `close` functionality.

To make things easier, we moved the global window event to a scoped div
(the Dialog itself). While that fixed the nested Dialog issue, it
introduced this bug where `escape` would not close if you click on a
non-focusable element like a span in the Dialog.

Since that PR we did a bunch of improvements on how the underlying
"stacking" system worked.
This PR reverts to the "global" window event listener so that we can
still catch all of the `escape` keydown events.

Fixes: #524
Fixes: #693

* update changelog
* warn instead of error when there are no focusable elements

* update changelog

Co-authored-by: Krystof Rehacek <krystofee@gmail.com>
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.

1 participant