Skip to content

Commit 9075205

Browse files
committed
Fixes inconsistent MenuBar show/hide toggling
Signed-off-by: Raul <r.ferreira.fuentes@gmail.com>
1 parent c5bb63c commit 9075205

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/components/MenuBar.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ export default {
185185
submenuVisibility: {},
186186
lastImagePath: null,
187187
icons: [...menuBarIcons],
188+
editorHasFocus: false
188189
}
189190
},
190191
computed: {
@@ -209,7 +210,7 @@ export default {
209210
}
210211
},
211212
isVisible() {
212-
return this.$editor.isFocused
213+
return this.editorHasFocus
213214
|| Object.values(this.submenuVisibility).find((v) => v)
214215
},
215216
disabled() {
@@ -278,6 +279,14 @@ export default {
278279
}
279280
}, 100)
280281
this.$emit('update:loaded', true)
282+
283+
this.$editor.on('focus', _ => {
284+
this.editorHasFocus = true
285+
})
286+
287+
this.$editor.on('blur', _ => {
288+
this.editorHasFocus = false
289+
})
281290
},
282291
beforeDestroy() {
283292
window.removeEventListener('resize', this.getWindowWidth)

0 commit comments

Comments
 (0)