ariakit icon indicating copy to clipboard operation
ariakit copied to clipboard

Support drag-to-select on select/menu.

Open latin-1 opened this issue 3 years ago • 1 comments

Motivation

Sorry I don't know the exact name of this UX.

image

It's a common pattern and should be supported in Ariakit.

Usage example

Possible implementations

No response

latin-1 avatar May 12 '22 13:05 latin-1

Thanks for suggesting this feature @latin-1.

We've tried this at some point in the past and observed it had some inconsistent behaviors (especially when you consider touch devices, different/multiple pointers, and swipe to scroll). So we decided to support only full clicks by default.

Nonetheless, this behavior is not a standard across all platforms. Windows, for example, doesn't work like that.

That being said, if you really need this behavior in your app, you can do this by opting out of the default behavior and adding the event handler yourself:

<SelectItem
  value="Banana"
  hideOnClick={false}
  setValueOnClick={false}
  onMouseUp={() => {
    select.hide();
    select.setValue("Banana");
  }}
/>

diegohaz avatar May 18 '22 09:05 diegohaz

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 24 '22 08:12 stale[bot]