-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shortcut to focus the "find label" input field #938
Conversation
- override the default feature
…tool shortcuts list
- Add openSidebarLabels() method to trigger sidebar label view and focus typeahead - Register 'focusTypeaheadEvent' and 'callFunctionFocustypeahead' events to manage typeahead focus - Bind 'Ctrl + K' shortcut to openSidebarLabels()
-Resolve merge conflicts by integrating code changes from both branches.
… tab to focus Input
resources/views/manual/tutorials/annotations/shortcuts.blade.php
Outdated
Show resolved
Hide resolved
resources/views/manual/tutorials/annotations/shortcuts.blade.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After reviewing the annotatorContainer
, it would be the best to move the methods to focus the input from the annotatorContainer
into the labelsTab
component.
The annotatorContainer
should just be responsible to open the sidebar. Additionally, you can merge the openSidebarLabels()
and setFocusInputLabels()
methods into a single method for simplicity.
Once the methods are moved, replace this.$refs.sidebar.$emit(...)
in LabelsTab
with this.$emit('open', 'labels')
. Then, update the corresponding labels.blade
file as follows:
- Replace
<labels-tab ... :focus-input="focusInputFindLabel"
with<labels-tab ... v-on:open="openSidebar"
. - Replace
<labels-trees ... :focus-input="focusInput"
with<labels-trees ... :focus-input="focusInputFindLabel"
.
The method openSidebar
is used in the annotatorContainer
.
The goal is to listen for keyboard events in LabelsTab
, emit an event to the annotatorContainer
, and then let the annotatorContainer
emit an event to open the sidebar. This prevents polluting the annotatorContainer.
Sorry for all the back and forth.
…b component - did not do so for video annotation, because of different structure
Just curious, as it seems to work already... is this ready for review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Shortcut Ctrl+k to focus the "find label" input field of the label trees component in the sidebar of the annotation tools
references #476