Skip to content

Disable select item with mouse#116

Merged
pacocoursey merged 7 commits into
dip:mainfrom
joaom00:mouse-event-select
Jan 30, 2024
Merged

Disable select item with mouse#116
pacocoursey merged 7 commits into
dip:mainfrom
joaom00:mouse-event-select

Conversation

@joaom00

@joaom00 joaom00 commented Apr 11, 2023

Copy link
Copy Markdown
Contributor

As discussed in #49 keyboard-only item selection is the new default. I didn't add a prop to enable mouse selection because this can be implemented by the consumer if he wants to. What do you think?

I think the only problem here is that the mouse selection style will break for users so would this be a breaking change?

Adding a new prop disablePointerSelection to disable item selection via pointer events

@vercel

vercel Bot commented Apr 11, 2023

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cmdk-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 30, 2024 3:45am

@phil-loops

phil-loops commented Apr 14, 2023

Copy link
Copy Markdown

Played around on the demo site in safari. Seems to have solved a big chunk of the woes on that browser!

What would you think of having the mouse behavior controlled by a new prop? Might be able to keep the old styling, but enable new opt-in behavior.

@joaom00

joaom00 commented Apr 16, 2023

Copy link
Copy Markdown
Contributor Author

I'm in favor of letting the user make the selection with mouse but it can require a slight boilerplate so enabling this behavior with a prop is not a bad thing. I believe that the correct approach here is to disable the mouse selection with a prop and make this the default in a future v1 release

@trymbill

trymbill commented May 4, 2023

Copy link
Copy Markdown

Would love to see this merged. Feels a lot more intuitive and less prone to accidental selections.

@joaom00

joaom00 commented May 9, 2023

Copy link
Copy Markdown
Contributor Author

@pacocoursey would like to know what you think!

@pacocoursey pacocoursey left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@Just-Moh-it

Copy link
Copy Markdown

@pacocoursey not sure if this made it to the 0.2.1 release. Seems like this was merged the same day the release 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants