File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 8484 :disabled =" stateCardCreating"
8585 :placeholder =" t('deck', 'Card name')"
8686 required
87+ pattern =" .*\S+.*"
8788 @keydown.esc =" stopCardCreation" >
88-
8989 <input v-show =" !stateCardCreating"
9090 class =" icon-confirm"
9191 type =" submit"
Original file line number Diff line number Diff line change @@ -227,6 +227,7 @@ import {
227227 getMonthNamesShort ,
228228} from ' @nextcloud/l10n'
229229import moment from ' @nextcloud/moment'
230+ import { showError } from ' @nextcloud/dialogs'
230231
231232const markdownIt = new MarkdownIt ({
232233 linkify: true ,
@@ -464,6 +465,10 @@ export default {
464465 this .descriptionSaving = false
465466 },
466467 updateTitle (newTitle ) {
468+ if (newTitle .trim === ' ' ) {
469+ showError (t (' deck' , ' The title cannot be empty.' ))
470+ return
471+ }
467472 this .$set (this .copiedCard , ' title' , newTitle)
468473 this .$store .dispatch (' updateCardTitle' , this .copiedCard ).then (() => {
469474 this .titleEditable = false
Original file line number Diff line number Diff line change 4343 class =" dragDisabled"
4444 @keyup.esc =" cancelEdit"
4545 @submit.prevent =" finishedEdit(card)" >
46- <input v-model =" copiedCard.title" v-focus type =" text" >
47- <input type =" button" class =" icon-confirm" @click =" finishedEdit(card)" >
46+ <input v-model =" copiedCard.title"
47+ v-focus
48+ type =" text"
49+ required
50+ pattern =" .*\S+.*" >
51+ <input type =" submit" value =" " class =" icon-confirm" >
4852 </form >
4953
5054 <DueDate v-if =" !editing" :card =" card" />
You can’t perform that action at this time.
0 commit comments