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

Improve internal demo mode #3143

Merged
merged 5 commits into from Apr 26, 2024
Merged

Improve internal demo mode #3143

merged 5 commits into from Apr 26, 2024

Conversation

RobinMalfait
Copy link
Collaborator

This PR improves the internal demo modes for the following components:

  • Dialog
  • Combobox
  • Menu
  • Popover

This PR also adds a demo mode for the Listbox component.

This still disabled `inert` and focus stealing code. But it does allow
outside click.
Copy link

vercel bot commented Apr 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
headlessui-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 26, 2024 2:30pm
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 26, 2024 2:30pm

Comment on lines -130 to -136

/* We can turn off demo mode once we re-open the `Popover` */
if (nextState.popoverState === PopoverStates.Open) {
nextState.__demoMode = false
}

return nextState
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can always turn off demo mode 👍

Comment on lines -1756 to -1757
if (!data.virtual) return
if (!data.__demoMode) return
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These conditions were incorrect. We don't want to scroll into view when virtual mode is used or when demo mode is used.

@RobinMalfait RobinMalfait merged commit 539c124 into main Apr 26, 2024
8 checks passed
@RobinMalfait RobinMalfait deleted the improve-demo-mode branch April 26, 2024 14:35
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.

None yet

2 participants