vmware-clarity / core

Clarity is a scalable, accessible, customizable, open-source design system built with web components. Works with any JavaScript framework, created for enterprises, and designed to be inclusive.
https://clarity.design
MIT License
166 stars 42 forks source link

CdsDropdown onCloseChange not called when the area outside of the dropdown is clicked #150

Closed ashleyryan closed 2 years ago

ashleyryan commented 2 years ago

Describe the bug

For CdsDropdown (and signpost and responsive dropdown), the onCloseChange callback is not called when the overlay outside of the dropdown is clicked.

How to reproduce

https://stackblitz.com/edit/clarity-react-demo-ujuhus?file=src%2FApp.tsx

Steps to reproduce the behavior:

  1. Click on button to open dropdown
  2. Click outside dropdown
  3. Note that the dropdown doesn't close when focus is trying to move outside of it

Expected behavior

The dropdown should close like the web component does: https://stackblitz.com/edit/clarity-typescript-demo-m6anoy?file=src%2Findex.ts,src%2Findex.html

Versions

Clarity project:

Clarity version:

Framework:

github-actions[bot] commented 2 years ago

Hi there 👋, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.