diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 1fec1e6c9..f218ba9a6 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -99,6 +99,10 @@ const $props = defineProps({ type: Function, default: () => {}, }, + preventSubmit: { + type: Boolean, + default: true, + }, }); const emit = defineEmits(['onFetch', 'onDataSaved']); const modelValue = computed( @@ -301,7 +305,7 @@ function onBeforeSave(formData, originalData) { ); } async function onKeyup(evt) { - if (evt.key === 'Enter' && !('prevent-submit' in attrs)) { + if (evt.key === 'Enter' && !$props.preventSubmit) { const input = evt.target; if (input.type == 'textarea' && evt.shiftKey) { let { selectionStart, selectionEnd } = input; @@ -330,6 +334,7 @@ defineExpose({