diff --git a/packages/nc-gui/components/cell/DatePicker.vue b/packages/nc-gui/components/cell/DatePicker.vue index a21fab44e8..878ab83887 100644 --- a/packages/nc-gui/components/cell/DatePicker.vue +++ b/packages/nc-gui/components/cell/DatePicker.vue @@ -29,6 +29,8 @@ const isGrid = inject(IsGridInj, ref(false)) const isForm = inject(IsFormInj, ref(false)) +const isSurveyForm = inject(IsSurveyFormInj, ref(false)) + const isExpandedForm = inject(IsExpandedFormOpenInj, ref(false)) const isDateInvalid = ref(false) @@ -193,6 +195,9 @@ const handleKeydown = (e: KeyboardEvent, _open?: boolean) => { switch (e.key) { case 'Enter': e.preventDefault() + if (isSurveyForm.value) { + e.stopPropagation() + } localState.value = tempDate.value open.value = !_open diff --git a/packages/nc-gui/components/cell/DateTimePicker.vue b/packages/nc-gui/components/cell/DateTimePicker.vue index 45fb5fb082..78cd8e3c1b 100644 --- a/packages/nc-gui/components/cell/DateTimePicker.vue +++ b/packages/nc-gui/components/cell/DateTimePicker.vue @@ -25,6 +25,8 @@ const isGrid = inject(IsGridInj, ref(false)) const isForm = inject(IsFormInj, ref(false)) +const isSurveyForm = inject(IsSurveyFormInj, ref(false)) + const { t } = useI18n() const isEditColumn = inject(EditColumnInj, ref(false)) @@ -225,6 +227,10 @@ const handleKeydown = (e: KeyboardEvent, _open?: boolean, _isDatePicker: boolean switch (e.key) { case 'Enter': e.preventDefault() + if (isSurveyForm.value) { + e.stopPropagation() + } + localState.value = tempDate.value if (!_isDatePicker) { e.stopPropagation() diff --git a/packages/nc-gui/components/cell/TimePicker.vue b/packages/nc-gui/components/cell/TimePicker.vue index 662303a163..96627b52c2 100644 --- a/packages/nc-gui/components/cell/TimePicker.vue +++ b/packages/nc-gui/components/cell/TimePicker.vue @@ -27,6 +27,8 @@ const isGrid = inject(IsGridInj, ref(false)) const isForm = inject(IsFormInj, ref(false)) +const isSurveyForm = inject(IsSurveyFormInj, ref(false)) + const isExpandedForm = inject(IsExpandedFormOpenInj, ref(false)) const column = inject(ColumnInj)! @@ -171,6 +173,10 @@ const handleKeydown = (e: KeyboardEvent, _open?: boolean) => { switch (e.key) { case 'Enter': e.preventDefault() + if (isSurveyForm.value) { + e.stopPropagation() + } + localState.value = tempDate.value open.value = !_open if (!open.value) { diff --git a/packages/nc-gui/components/cell/YearPicker.vue b/packages/nc-gui/components/cell/YearPicker.vue index 9c3dd5e7d3..e4ae1b5c21 100644 --- a/packages/nc-gui/components/cell/YearPicker.vue +++ b/packages/nc-gui/components/cell/YearPicker.vue @@ -27,6 +27,8 @@ const isGrid = inject(IsGridInj, ref(false)) const isForm = inject(IsFormInj, ref(false)) +const isSurveyForm = inject(IsSurveyFormInj, ref(false)) + const isExpandedForm = inject(IsExpandedFormOpenInj, ref(false)) const isYearInvalid = ref(false) @@ -157,6 +159,10 @@ const handleKeydown = (e: KeyboardEvent, _open?: boolean) => { switch (e.key) { case 'Enter': e.preventDefault() + if (isSurveyForm.value) { + e.stopPropagation() + } + localState.value = tempDate.value open.value = !_open if (!open.value) { diff --git a/packages/nc-gui/components/smartsheet/Form.vue b/packages/nc-gui/components/smartsheet/Form.vue index b35e9324ca..847dc1aea2 100644 --- a/packages/nc-gui/components/smartsheet/Form.vue +++ b/packages/nc-gui/components/smartsheet/Form.vue @@ -1196,7 +1196,7 @@ useEventListener( }" > -
+
@@ -1297,7 +1297,7 @@ useEventListener(