Fix checklist item alignments and placeholder text [SCI-6961] (#4211)

This commit is contained in:
ajugo 2022-07-11 11:52:38 +02:00 committed by GitHub
parent cb86fe0e06
commit 045485ff45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 2 deletions

View file

@ -2,6 +2,15 @@
// scss-lint:disable NestingDepth
.step-checklist-items {
.sci-inline-edit {
margin-top: 2px;
.sci-inline-edit__content {
padding-bottom: 7px;
padding-top: 7px;
}
}
.step-element-header {
.step-element-name {
align-items: flex-start;
@ -26,6 +35,10 @@
.step-checklist-add-item {
margin-left: 9px;
.fas {
margin-right: .5em;
}
}
.step-checklist-item-ghost {

View file

@ -19,11 +19,12 @@
:value="checklistItem.attributes.text"
:sa_value="checklistItem.attributes.sa_text"
:characterLimit="10000"
:placeholder="''"
:placeholder="'Add a checklist item...'"
:allowBlank="true"
:autofocus="editingText"
:attributeName="`${i18n.t('ChecklistItem')} ${i18n.t('name')}`"
:multilinePaste="true"
:editOnload="newItem()"
:smartAnnotation="true"
@editingEnabled="enableTextEdit"
@editingDisabled="disableTextEdit"
@ -130,6 +131,9 @@
this.$emit('removeItem', this.checklistItem.attributes.position);
}
},
newItem(){
return this.checklistItem.attributes.text === ''
},
update() {
this.$emit('update', this.checklistItem);
}

View file

@ -84,7 +84,7 @@
},
methods: {
handleAutofocus() {
if (this.autofocus || !this.placeholder && this.isBlank) {
if (this.autofocus || !this.placeholder && this.isBlank || this.editOnload && this.isBlank) {
this.enableEdit();
setTimeout(this.focus, 50);
}