atlantis icon indicating copy to clipboard operation
atlantis copied to clipboard

feat(components): Add closeOnActionClick prop to Combobox.Action

Open taylorvnoj opened this issue 4 months ago • 3 comments

Motivations

We want to provide a way for the consumer to close the Combobox after interacting with a Combobox.Action, other than the user clicking outside of the combobox.

If a Combobox.Action opened a modal for example, the Combobox would remain open and on top of the modal layer. Now, implementors can put closeOnActionClick as a prop on Combobox.Action to see the Combobox close after clicking an action.

Changes

Added

New prop closeOnActionClick on ComboboxActionProps

  • defaults to false to align with current behaviour

Updated the Action section on the Combobox Docs page, and added a new Close On Action Click story example

Also updated the ComboboxAction.test.tsx file. Since I'm now utilizing setOpen from ComboboxContext, I wanted to tuck away the ComboboxContextProvider wrapper and keep the test file clean. I added a test, it("closes the Combobox when closeOnActionClick is true")

Testing

Test via the Close on Action Click story

Pre-release test branch is tagged below


In Atlantis we use Github's built in pull request reviews.

Random photo of Atlantis

taylorvnoj avatar Oct 02 '24 20:10 taylorvnoj