Repository navigation
[combobox] Support drag-to-select - #3167
Conversation
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
3daed83 to
c7dc6f6
Compare
Signed-off-by: atomiks <[email protected]>
| event.button !== 0 || | ||
| pointerStartedOnItem || | ||
| !highlighted || | ||
| !store.state.inputInsidePopup |
There was a problem hiding this comment.
Just wondering could this also work for input-outside-popup? If the pointer starts at the smaller trigger, not the input
There was a problem hiding this comment.
Possibly, though it feels a bit inconsistent for it to work only on the trigger with that layout/pattern
There was a problem hiding this comment.
I agree with the proposal.
Seems strange to support this only on the popup mode, whereas regular Combobox closely resembles Select, but does not allow this behavior.
If we keep this behavior as is, then maybe the trigger drag -> move away behavior should change in regular behavior?
It seems slightly strange now. 🤷
Screen.Recording.2025-11-11.at.16.49.34.mov
There was a problem hiding this comment.
Dragging on the input selects the text (if you had some in the input in that recording) though, so there's a functional difference there. Pretty sure no one is going to notice any of this though.
I removed the mouseup drag out behavior to match the input
There was a problem hiding this comment.
OK I don't think it's hugely important now, but would be nice to have later ~
RA let's you single-pointer the trigger in this layout: https://react-spectrum.adobe.com/react-aria/ComboBox.html#example
Also maybe because it's styled it more distinctly from the input, seems like this interaction would be more discoverable
There was a problem hiding this comment.
Hmm fair enough, the styled trigger does make it more clear there. I think we can unconditionally allow drags on both the trigger and input (even if it selects text) for consistency across both, but leave the cancel-open exclusive to the input-inside-popup layout
Signed-off-by: atomiks <[email protected]>
LukasTy
left a comment
There was a problem hiding this comment.
Looks great, especially after the tiny fix. 👌
b377262 to
45047c6
Compare
|
Is it expected that releasing the mouse outside of the Popup closes the Popup in case of https://deploy-preview-3167--base-ui.netlify.app/react/components/combobox#input-inside-popup, but doesn't when used with an input? 🤔 |
|
@LukasTy yeah so it's consistent with the input: #3167 (comment) |
Closes #3086