Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
289 stars 76 forks source link

Bug: calcite-combobox should close with dropdown open when clicking on box #3058

Closed AdelheidF closed 2 years ago

AdelheidF commented 3 years ago

Click twice on the yellow highlighted area of the combobox. It should close the dropdown on the second click. If you do this to the also highlighted calcite-select box for overlay-positioning then this is how it works there.

https://developers.arcgis.com/calcite-design-system/components/combobox/ image

Actual Behavior

Expected Behavior

Reproduction Steps and Sample

Sample:

1.

Relevant Info

Version: @esri/calcite-components@<version>

github-actions[bot] commented 3 years ago

More information is required to proceed with this issue:

This issue will be automatically closed in three days if the information is not provided. Thanks for your understanding.

AdelheidF commented 3 years ago

from @kevindoshier

https://codepen.io/kevindoshier/pen/YzQYRZm

macandcheese commented 3 years ago

This is a reasonable enhancement (not sure if it's a bug - just never addressed in design or implementation). This change would match how calcite-dropdown works in regards to the trigger being a toggle (as well as anywhere else on the page).

There are probably some edge cases to handle - what happens when you have a "half entered" string and a user clicks on the input to close the dropdown? For "allows adding values" - is that value entered as a value / chip?

Regarding calcite-select, it looks like our "cursor: pointer" that is set for an open calcite-select persists across other elements on the page. It should probably revert to "cursor:normal" like a native select while not hovering over the element's container. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select

macandcheese commented 2 years ago

We should match the behavior requested in the OP - example of "click on input to close" : https://mui.com/components/autocomplete/

jcfranco commented 2 years ago

I believe this got fixed in beta.81 (via https://github.com/Esri/calcite-components/pull/4218): https://codepen.io/jcfranco/pen/zYpbbKX.

The doc example now behaves as this issue expected.

AdelheidF commented 2 years ago

looks good now, closing