Data Manager shortcuts does not work (Shift+ArrowKey)
Describe the bug Can not navigate through images using shortcuts (Shift+ArrowKey)
To Reproduce Steps to reproduce the behavior:
- Import images in Label Studio Community version
- Start annotating. Ctrl+Enter will submit the changes
- Shift+ArrowKey will not do anything.
Expected behavior It should work as described in user/account/hotkeys under Data Manager sub-window Shortcuts for navigating and managing tasks in Project's Data Manager.
Environment (please complete the following information):
- OS: Win11
- Label Studio Version 1.23.0
Additional context It was working in previous version.
Hello,
Thank you for contacting Label Studio, Could you please try these quick checks to help isolate it and let us know the outcome
- Test in another browser.
- Test in an incognito/private window.
- Disable browser extensions temporarily.
- Confirm whether it fails only in the labeling view, or also in the Data Manager task list/quick view.
Best Regards!
Comment by Oussama Assili Workflow Run
Hello,
thank you for your reply.
-
Tested in Edge, Firefox, Arc
- Browser Extensions on & off
- Private & incognito
-
It fails in Data Manager and Labeling View. (I checked again - Shift+ArrowKey is fully functional in v1.22.0)
Best Regards
Shortcut keys are indeed not easy to use in v1.23.0, but v1.22.0 is normal.
Hello,
Thank you for your feedback! We are currently looking into this matter with our engineering team. will follow up accordingly! Best Regards!
Comment by Oussama Assili Workflow Run
Ran into this today myself - it works if you click the focus back onto the main banner of the website.
So click on the empty space next to the breadcrumb, then shortcut will work. On next page it now won't work until you click on the empty space again or anything in that bar (e.g. the keyboard shortcut toast).
Not ideal!
EDIT: Can confirm that it is all working fine on v1.22.0, will stick to this version.
same issue for me too , and clicking on the header and trying a shortcut is working , and once one shortcut is activated , then again i have to click on the header to use another shortcut , so thats not the actuall solution !! can anyone confirm if its working on a specific version ?
I can also confirm that downgrading to v1.22 worked. There are significant changes between versions, so this may not be a viable option. But it does fix the issue.
+1, downgrading to v1.22 as workaround
I dug into this on 1.23.0. There are three separate guards that kill dm.focus-previous / dm.focus-next while a task is open, which is why fixing only the lsfLabeling check (#9650) doesn't fully bring it back:
web/libs/datamanager/src/sdk/hotkeys.ts:useShortcutreturns for every DM shortcut whendocument.body.dataset.lsfLabeling === "true". Only Shift+←/→ actually collide with editor hotkeys.web/libs/datamanager/src/components/MainView/DataView/Table.jsx: the focus-previous/next handlers return unlessdocument.activeElement === document.body. Any click inside the labeling panel moves focus off<body>.- hotkeys-js default filter (used by react-hotkeys-hook): it drops key events whose target is an
INPUT/TEXTAREA/SELECT. AChoiceis an antd Radio, i.e.<input type="radio">. So after clicking a choice in a classification project, the event never reaches the handler at all.
All three affect custom bindings too, e.g. remapping data_manager:dm.focus-next to Ctrl+→ in hotkey settings.
I opened #10047, which fixes all three:
- an opt-in
yieldToEditorflag in the keymap, set only on Shift+←/→; - a "skip only while typing" check in place of the body-focus check;
- a custom hotkeys filter.
It includes unit tests.
Workaround until it's released: call window.DM.dataStore.focusNext() / focusPrev() followed by window.DM.startLabeling(task) from your own key handler.