Opened 14 years ago

Closed 10 years ago

#4013 closed feature (wontfix)

Selectable - Include option to act as CTRL/CMD key always pressed.

Reported by: luenyar Owned by: luenyar
Priority: minor Milestone: 2.0.0
Component: ui.selectable Version: 1.6rc6
Keywords: Cc:
Blocked by: Blocking:

Description

It would be handy to be able to set an option to Selectable that causes it to behave as if CTRL/CMD key is always pressed, ie never start a new select, just keep adding to the selection. It is very possible I am the only person that would find this useful but I think it would also be an easy addition. Anywhere the event.metakey is checked, it could also check for options.mode or whatever it might be named.

Change History (9)

comment:1 Changed 14 years ago by Jörn Zaefferer

Milestone: TBD1.next

Seems reasonable, but certainly not a high priority.

comment:2 Changed 11 years ago by Scott González

Type: enhancementfeature

comment:3 Changed 10 years ago by Scott González

Milestone: 1.next2.0.0

comment:4 Changed 10 years ago by Jörn Zaefferer

Status: newopen

To be considered for the rewrite. Should be possible to customize enough to get this behaviour, probably through events/methods, not an option.

comment:5 Changed 10 years ago by Scott González

Owner: set to luenyar
Status: openpending

Would this make it impossible to unselect a specific item or would you want cmd+click to be inverted? What are the use cases?

comment:6 in reply to:  5 Changed 10 years ago by luenyar

Status: pendingnew

Replying to scott.gonzalez:

Would this make it impossible to unselect a specific item or would you want cmd+click to be inverted? What are the use cases?

You can deselect, the way I did it at least. I have a table of data I want to selectively output to something else. Clicking row 3 highlights it. Clicking row 5 highlights it. Clicking row 3 again deselects it. Same functionality as is currently available if CTRL/CMD is used, just saves the user having to hold it. Useful in my case because user is often selecting multiple non-adjacent rows. I did it "improperly" by adding to the core file, _mouseStart function, "event.metaKey=true" , but could be "event.metaKey=options.metaKeyMode" or something more, proper.

comment:7 Changed 10 years ago by Scott González

Status: newpending

I'd rather see users implement this on top of #7013. This type of behavior is often tied to checkboxes as well. Is there anything we'd be missing that would make this difficult to use if there were methods for toggling the selected state of specific elements?

comment:8 Changed 10 years ago by luenyar

Status: pendingnew

I think you might be right. If a tr or div click event can toggle its own selected state, the end result should be the same. Plus that should extend to the trap selection functionality too right? Drag a trap around several rows and toggle them all?

comment:9 Changed 10 years ago by Scott González

Resolution: wontfix
Status: newclosed

We'll have to wait until the new API is designed to figure out the specifics, but as of right now, I'd say yes.

Note: See TracTickets for help on using tickets.