fix focusing ribbon tabs when using keyboard navigation on the tree

This commit is contained in:
zadam 2022-07-30 23:43:20 +02:00
parent 7c90f1a56d
commit 4c93334d90

View File

@ -188,10 +188,12 @@ export default class RibbonContainer extends NoteContextAwareWidget {
if (activeChild && (refreshActiveTab || !wasAlreadyActive)) { if (activeChild && (refreshActiveTab || !wasAlreadyActive)) {
const handleEventPromise = activeChild.handleEvent('noteSwitched', {noteContext: this.noteContext, notePath: this.notePath}); const handleEventPromise = activeChild.handleEvent('noteSwitched', {noteContext: this.noteContext, notePath: this.notePath});
if (handleEventPromise) { if (refreshActiveTab) {
handleEventPromise.then(() => activeChild.focus?.()); if (handleEventPromise) {
} else { handleEventPromise.then(() => activeChild.focus?.());
activeChild.focus?.(); } else {
activeChild.focus?.();
}
} }
} }
} else { } else {