question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Row mulit-select on Mac using Command key

See original GitHub issue

Describe the bug Users are conditioned to use the Command key when selecting multiple rows on Mac computers, but the code only matches against ctrlKey.

Tabulator Info

  • Which version of Tabulator are you using? v4.2.7

Expected behavior The Command key on Macs should work as Ctrl key in Windows to multiselect rows.

Additional context I do not have a ton of experience with Mac computers, but in most cases, the Cmd key does in Mac OS, what the Ctrl key does in Windows. Users alerted me that the Command key does not work with selecting multiple rows in the grid. The code in modules/select_row.js only checks for ctrlKey on the keypress event object.

After researching and testing how to capture the Command key, I have found out that different browsers report different data for the event. The Cmd key on Mac is equivalent to the Win key on Windows, which reports 91 as the keycode (event.which) in Chrome, Firefox, and Edge, and IE11. On Mac OS, the Cmd key reports keycode 91 under Safari and Chrome, but 224 under Firefox. The OSes and browsers report other vastly different values for event.key and event.code, so your best bet is to probably code off of event.which to capture multiselect intent on Mac.

I don’t believe keycode 224 is mapped to anything else, so you could probably just write: var ctrlKey = e.ctrlKey || e.which == 91 || e.which == 224;

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
haferjecommented, Jun 9, 2019

I’m not a Mac user but I do have access to one, so I can give it a shot.

0reactions
olifolkerdcommented, Jul 20, 2019

This has been merged in, and will be included in sundays 4.3 release.

Cheers

Oli 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Quick Tip: How to Select Multiple Items in the macOS Finder
Select the first file, hold down the Shift key, then click the last file. All files between those two will be selected.
Read more >
How to select multiple files on macOS - AddictiveTips
Select files on macOS ; Keyboard shortcut: Command+A ; Touchpad gesture: Click and drag over all files ; Keyboard: ; Touchpad gesture: Click...
Read more >
【2022 Fixed】3 Ways to Select Multiple Files on Mac
Fix 1: Shift + Click. To select multiple contiguous files simply select the first file from the batch, press 'Shift', and then select...
Read more >
How to Select Multiple Files on Mac in 4 Ways | Digital Trends
To select various files, the easiest way is to hold Cmd and click on the files you want. As long as you have...
Read more >
Selecting Multiple Files on an Apple Mac - YouTube
It is great to use shift to select a whole row, and then try holding command and clicking on the individual files that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found