Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#9196 closed bug (notabug)

configure to disable unless modifier key is pressed

Reported by: penguin_brian Owned by:
Priority: minor Milestone: none
Component: ui.selectable Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:


e.g. put something like

if (!event.metaKey && !event.ctrlKey && !event.shiftKey) {

At top of _mouseStart function. Might be better to make it configurable.

That way if there are links, etc, on this selectable item, the user can still click on the links, and get select functionality by using one of the modifier keys

Change History (5)

comment:1 Changed 10 years ago by tj.vantoll

Resolution: notabug
Status: newclosed

Hi penguin_brian,

Thanks for taking the time to contribute to the jQuery UI project. The cancel option ( should provide the functionality that you're describing:


comment:2 Changed 10 years ago by penguin_brian

Interesting idea.

Unfortunately, that does not help in my case, as the entire item is clickable. I want to leave it as clickable if no modifier keys have been pushed.


comment:3 Changed 10 years ago by tj.vantoll

I don't believe this to be a common use case and you can accomplish this fairly easily with the cancel option: If you need further help use the forums or Stack Overflow.

comment:4 Changed 10 years ago by penguin_brian

Like I said, the cancel option does something different entirely. It does not solve my problem.

comment:5 Changed 10 years ago by penguin_brian

So the best way forward might be for me to create a new widget derived from ui.selectable that overrides _mouseStart and only calls the parent class if my criteria is satisfied. Still learning jquery and jquery-ui, but it looks like it should be possible.

Note: See TracTickets for help on using tickets.