1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-07 14:25:37 +00:00

Prevent validation error message to be displayed when adding a new field to a table

This commit is contained in:
Jonathan Adeline 2023-03-20 09:52:05 +00:00
parent 8959e85c44
commit d546474a51
3 changed files with 15 additions and 0 deletions
changelog/entries/unreleased/bug
web-frontend/modules/database/components/field

View file

@ -0,0 +1,7 @@
{
"type": "bug",
"message": "Prevent validation error message to be displayed when adding a new field",
"issue_number": null,
"bullet_points": [],
"created_at": "2023-03-08"
}

View file

@ -9,9 +9,11 @@
:table="table"
:forced-type="forcedType"
@submitted="submit"
@keydown-enter="$refs.submitButton.focus()"
>
<div class="context__form-actions">
<button
ref="submitButton"
class="button"
:class="{ 'button--loading': loading }"
:disabled="loading"

View file

@ -11,6 +11,7 @@
:placeholder="$t('fieldForm.name')"
@blur="$v.values.name.$touch()"
@input="isPrefilledWithSuggestedFieldName = false"
@keydown.enter="handleKeydownEnter($event)"
/>
<div
v-if="$v.values.name.$dirty && !$v.values.name.required"
@ -207,6 +208,11 @@ export default {
const excludeNames = this.fields.map((f) => f.name)
return getNextAvailableNameInSequence(baseName, excludeNames)
},
handleKeydownEnter(event) {
event.preventDefault()
this.$emit('keydown-enter')
this.submit()
},
},
}
</script>