Skip to content

Commit

Permalink
fix focusing ribbon tabs when using keyboard navigation on the tree
Browse files Browse the repository at this point in the history
  • Loading branch information
zadam committed Jul 30, 2022
1 parent 7c90f1a commit 4c93334
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/public/app/widgets/containers/ribbon_container.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,12 @@ export default class RibbonContainer extends NoteContextAwareWidget {
if (activeChild && (refreshActiveTab || !wasAlreadyActive)) {
const handleEventPromise = activeChild.handleEvent('noteSwitched', {noteContext: this.noteContext, notePath: this.notePath});

if (handleEventPromise) {
handleEventPromise.then(() => activeChild.focus?.());
} else {
activeChild.focus?.();
if (refreshActiveTab) {
if (handleEventPromise) {
handleEventPromise.then(() => activeChild.focus?.());
} else {
activeChild.focus?.();
}
}
}
} else {
Expand Down

0 comments on commit 4c93334

Please sign in to comment.