Hello! While following the default instructions for rendering a notification feed in my Next.js app, I ran into issues with the event handler for closing the popover when clicking on the bell icon.
It looks to be an issue where the popover onClose was firing first to set the isVisible state to false and then the button onClick was firing second, updating the isVisible state back to true. The result was that the popover would not toggle closed when clicking the 🔔, only when clicking on the document outside of the popover.
Note the onClose handler for the popover now detects if the clicked element is a child of the notification button. Have you noticed or had other reports of this? Is there somewhere I could submit a PR for the docs?
Hello! While following the default instructions for rendering a notification feed in my Next.js app, I ran into issues with the event handler for closing the popover when clicking on the bell icon.
It looks to be an issue where the popover
onClose
was firing first to set theisVisible
state tofalse
and then the buttononClick
was firing second, updating theisVisible
state back totrue
. The result was that the popover would not toggle closed when clicking the 🔔, only when clicking on the document outside of the popover.I solved it with the following changes:
Note the
onClose
handler for the popover now detects if the clicked element is a child of the notification button. Have you noticed or had other reports of this? Is there somewhere I could submit a PR for the docs?Cheers 🍻