Skip to content

Commit

Permalink
Merge pull request #110 from nextcloud/fix/noid/trim-text-values
Browse files Browse the repository at this point in the history
Trim text values
  • Loading branch information
julien-nc authored Aug 12, 2024
2 parents ff53114 + a117117 commit e6a263d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/fields/ListOfTextsField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ export default {
methods: {
onItemValueChanged(i, itemValue) {
const newValue = this.arrayValue.slice()
newValue[i] = itemValue
newValue[i] = itemValue?.trim()
this.$emit('update:value', newValue)
console.debug('onvaluechanggeeee', i, itemValue, newValue)
console.debug('[Assistant] on item value change', i, itemValue, newValue)
},
onDeleteItem(i) {
if (this.arrayValue.length === 1 && i === 0) {
Expand Down
6 changes: 5 additions & 1 deletion src/components/fields/TextField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
:label="field.description"
:placeholder="field.placeholder ?? field.description"
:title="field.name"
@update:value="$emit('update:value', $event)" />
@update:value="onUpdateValue" />
</template>
<script>
Expand Down Expand Up @@ -58,6 +58,10 @@ export default {
},
methods: {
onUpdateValue(newValue) {
console.debug('[Assistant] new text value', newValue)
this.$emit('update:value', newValue?.trim())
},
},
}
</script>
Expand Down

0 comments on commit e6a263d

Please sign in to comment.