question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to close Disclosure Panel

See original GitHub issue

Are there plans to add the following to the Disclosure component?

  • Close on click outside
  • close on the render prop object so we can close the disclosure from a button with it

Or should I be managing the open/closed state in my parent component?

Thanks for the help

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
RobinMalfaitcommented, Mar 5, 2021

Gotcha! I would recommend to use a Popover for that (https://github.com/tailwindlabs/headlessui/tree/develop/packages/@headlessui-react#popover). It is built on top of the Disclosure pattern, but it has “outside click” and “escape” to close functionality.

I’ll make sure that I add a list of features for each component and when to use them to the docs!

0reactions
gilesbutlercommented, Nov 25, 2022

Hey @RobinMalfait,

Sorry to hijack an old issue but I was just wondering, in your FAQ example above is it possible to have Disclosure Panels close other panels when they’re opened? I.e I click on a new FAQ and it closes the last one that I had open.

Thanks Giles

Read more comments on GitHub >

github_iconTop Results From Across the Web

HeadlessUI: Disclosure. Part 3 - JavaScript in Plain English
In this part, we are going to create a custom component as Disclosure Button. So when the user click on MyLink button. It...
Read more >
Feature: Close Disclosure Manually · Discussion #475 - GitHub
I store the close function from the currently opened panel as ref and call it when the next panel opens. My solution comes...
Read more >
React.js: How to close headlessui Disclosure modal from code?
I encountered an issue trying to close the headlessui Disclosure modal inside the panel. My goal is to have a button inside the...
Read more >
Texas Medical Disclosure Panel – Frequently Asked Questions
Can the provider delete information or text from the Panel's consent forms?
Read more >
Federal Mortgage Disclosure Requirements under the Truth in ...
Regulation Z therefore limits creditors' ability to provide revised Loan Estimates relative to the provision of the Closing Disclosure and to consummation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found