diff --git a/src/components/AppSidebar/NotesItem.vue b/src/components/AppSidebar/NotesItem.vue
index ef866cdd2..97aebf77a 100644
--- a/src/components/AppSidebar/NotesItem.vue
+++ b/src/components/AppSidebar/NotesItem.vue
@@ -35,7 +35,9 @@ License along with this library. If not, see .
@@ -86,6 +88,7 @@ export default {
.use(Mitl)
return {
md,
+ compositing: false,
}
},
watch: {
@@ -129,6 +132,18 @@ export default {
setNotes($event) {
this.setEditing(true, $event)
},
+ // Inspired by https://gist.github.com/gotraveltoworld/ecbd2ddc6a0d9bcee8baf396d683e1ba
+ compositionstart() {
+ this.compositing = true
+ },
+ compositionend() {
+ this.compositing = false
+ },
+ escKeyDown() {
+ if (!this.compositing) {
+ this.setEditing(false)
+ }
+ },
},
}
diff --git a/src/components/HeaderBar.vue b/src/components/HeaderBar.vue
index 8bc5c7ae9..8086740e3 100644
--- a/src/components/HeaderBar.vue
+++ b/src/components/HeaderBar.vue
@@ -33,8 +33,10 @@ License along with this library. If not, see .
:show-trailing-button="newTaskName !== ''"
:trailing-button-label="placeholder"
@trailing-button-click="addTask"
- @keyup.esc="clearNewTask($event)"
- @keyup.enter="addTask"
+ @compositionstart="compositionstart()"
+ @compositionend="compositionend()"
+ @keydown.esc="clearNewTask($event)"
+ @keydown.enter="addTask"
@paste.stop="addMultipleTasks">
@@ -83,6 +85,7 @@ export default {
showCreateMultipleTasksModal: false,
multipleTasks: { numberOfTasks: 0, tasks: {} },
additionalTaskProperties: {},
+ compositing: false,
}
},
computed: {
@@ -112,12 +115,27 @@ export default {
'createTask',
]),
+ compositionstart() {
+ this.compositing = true
+ },
+ compositionend() {
+ this.compositing = false
+ },
+
clearNewTask(event) {
+ if (this.compositing) {
+ return
+ }
+
event.target.blur()
this.newTaskName = ''
},
async addTask() {
+ if (this.compositing) {
+ return
+ }
+
const data = {
summary: this.newTaskName,
// If the task is created in the calendar view,