Browse Source

fix(gui): prevent escape key press event bubbling only if picker is active

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4222/head
Pranav C 2 years ago
parent
commit
62f04a05ee
  1. 6
      packages/nc-gui/components/cell/DatePicker.vue
  2. 6
      packages/nc-gui/components/cell/DateTimePicker.vue
  3. 6
      packages/nc-gui/components/cell/TimePicker.vue
  4. 6
      packages/nc-gui/components/cell/YearPicker.vue

6
packages/nc-gui/components/cell/DatePicker.vue

@ -79,8 +79,10 @@ useSelectedCellKeyupListener(active, (e: KeyboardEvent) => {
open.value = true open.value = true
break break
case 'Escape': case 'Escape':
e.stopPropagation() if (open.value) {
open.value = false e.stopPropagation()
open.value = false
}
break break
} }
}) })

6
packages/nc-gui/components/cell/DateTimePicker.vue

@ -68,8 +68,10 @@ useSelectedCellKeyupListener(active, (e: KeyboardEvent) => {
open.value = true open.value = true
break break
case 'Escape': case 'Escape':
e.stopPropagation() if (open.value) {
open.value = false e.stopPropagation()
open.value = false
}
break break
} }
}) })

6
packages/nc-gui/components/cell/TimePicker.vue

@ -77,8 +77,10 @@ useSelectedCellKeyupListener(active, (e: KeyboardEvent) => {
open.value = true open.value = true
break break
case 'Escape': case 'Escape':
e.stopPropagation() if (open.value) {
open.value = false e.stopPropagation()
open.value = false
}
break break
} }
}) })

6
packages/nc-gui/components/cell/YearPicker.vue

@ -67,8 +67,10 @@ useSelectedCellKeyupListener(active, (e: KeyboardEvent) => {
open.value = true open.value = true
break break
case 'Escape': case 'Escape':
e.stopPropagation() if (open.value) {
open.value = false e.stopPropagation()
open.value = false
}
break break
} }
}) })

Loading…
Cancel
Save