Browse Source

Merge pull request #5989 from nocodb/fix/avoid-undo-on-edit-mode

fix: prevent undo while editing
pull/5995/head
Raju Udava 1 year ago committed by GitHub
parent
commit
270f539820
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/nc-gui/components/cell/Currency.vue
  2. 2
      packages/nc-gui/components/cell/Decimal.vue
  3. 2
      packages/nc-gui/components/cell/Duration.vue
  4. 2
      packages/nc-gui/components/cell/Email.vue
  5. 2
      packages/nc-gui/components/cell/Float.vue
  6. 9
      packages/nc-gui/components/cell/Integer.vue
  7. 2
      packages/nc-gui/components/cell/Percent.vue
  8. 2
      packages/nc-gui/components/cell/Text.vue
  9. 2
      packages/nc-gui/components/cell/TextArea.vue
  10. 2
      packages/nc-gui/components/cell/Url.vue

2
packages/nc-gui/components/cell/Currency.vue

@ -83,6 +83,8 @@ onMounted(() => {
@keydown.right.stop
@keydown.up.stop
@keydown.delete.stop
@keydown.ctrl.z.stop
@keydown.meta.z.stop
@selectstart.capture.stop
@mousedown.stop
@contextmenu.stop

2
packages/nc-gui/components/cell/Decimal.vue

@ -55,6 +55,8 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && (el as HTMLInputEle
@keydown.right.stop
@keydown.up.stop
@keydown.delete.stop
@keydown.ctrl.z.stop
@keydown.meta.z.stop
@selectstart.capture.stop
@mousedown.stop
/>

2
packages/nc-gui/components/cell/Duration.vue

@ -96,6 +96,8 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && (el as HTMLInputEle
@keydown.right.stop
@keydown.up.stop
@keydown.delete.stop
@keydown.ctrl.z.stop
@keydown.meta.z.stop
@selectstart.capture.stop
@mousedown.stop
/>

2
packages/nc-gui/components/cell/Email.vue

@ -64,6 +64,8 @@ watch(
@keydown.right.stop
@keydown.up.stop
@keydown.delete.stop
@keydown.ctrl.z.stop
@keydown.meta.z.stop
@selectstart.capture.stop
@mousedown.stop
/>

2
packages/nc-gui/components/cell/Float.vue

@ -55,6 +55,8 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && (el as HTMLInputEle
@keydown.right.stop
@keydown.up.stop
@keydown.delete.stop
@keydown.ctrl.z.stop
@keydown.meta.z.stop
@selectstart.capture.stop
@mousedown.stop
/>

9
packages/nc-gui/components/cell/Integer.vue

@ -41,6 +41,15 @@ const isExpandedFormOpen = inject(IsExpandedFormOpenInj, ref(false))!
const focus: VNodeRef = (el) => !isExpandedFormOpen.value && (el as HTMLInputElement)?.focus()
function onKeyDown(evt: KeyboardEvent) {
const cmdOrCtrl = isMac() ? evt.metaKey : evt.ctrlKey
if (cmdOrCtrl && !evt.altKey) {
switch (evt.keyCode) {
case 90: {
evt.stopPropagation()
break
}
}
}
return evt.key === '.' && evt.preventDefault()
}
</script>

2
packages/nc-gui/components/cell/Percent.vue

@ -46,6 +46,8 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && (el as HTMLInputEle
@keydown.right.stop
@keydown.up.stop
@keydown.delete.stop
@keydown.ctrl.z.stop
@keydown.meta.z.stop
@selectstart.capture.stop
@mousedown.stop
/>

2
packages/nc-gui/components/cell/Text.vue

@ -38,6 +38,8 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && (el as HTMLInputEle
@keydown.right.stop
@keydown.up.stop
@keydown.delete.stop
@keydown.ctrl.z.stop
@keydown.meta.z.stop
@selectstart.capture.stop
@mousedown.stop
/>

2
packages/nc-gui/components/cell/TextArea.vue

@ -37,6 +37,8 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && (el as HTMLTextArea
@keydown.right.stop
@keydown.up.stop
@keydown.delete.stop
@keydown.ctrl.z.stop
@keydown.meta.z.stop
@selectstart.capture.stop
@mousedown.stop
/>

2
packages/nc-gui/components/cell/Url.vue

@ -93,6 +93,8 @@ watch(
@keydown.right.stop
@keydown.up.stop
@keydown.delete.stop
@keydown.ctrl.z.stop
@keydown.meta.z.stop
@selectstart.capture.stop
@mousedown.stop
/>

Loading…
Cancel
Save