Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117740399
D1738.1775160450.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D1738.1775160450.diff
View Options
diff --git a/src/resources/vue/Widgets/ListInput.vue b/src/resources/vue/Widgets/ListInput.vue
--- a/src/resources/vue/Widgets/ListInput.vue
+++ b/src/resources/vue/Widgets/ListInput.vue
@@ -28,13 +28,15 @@
id: { type: String, default: '' }
},
methods: {
- addItem() {
- let input = $(this.$el).find('.main-input')
- let value = input.val()
+ addItem(focus) {
+ let value = this.input.value
if (value) {
this.list.push(value)
- input.val('').focus()
+ this.input.value = ''
+ if (focus !== false) {
+ this.input.focus()
+ }
}
},
deleteItem(index) {
@@ -50,6 +52,18 @@
e.preventDefault()
}
}
+ },
+ mounted() {
+ this.input = $(this.$el).find('.main-input')[0]
+
+ // On form submit add the text from main input to the list
+ // Users tend to forget about pressing the "plus" button
+ // Note: We can't use form.onsubmit (too late)
+ // Note: Use of input.onblur has been proven to be problematic
+ // TODO: What with forms that have no submit button?
+ $(this.$el).closest('form').find('button[type=submit]').on('click', () => {
+ this.addItem(false)
+ })
}
}
</script>
diff --git a/src/tests/Functional/Methods/DomainTest.php b/src/tests/Functional/Methods/DomainTest.php
--- a/src/tests/Functional/Methods/DomainTest.php
+++ b/src/tests/Functional/Methods/DomainTest.php
@@ -110,5 +110,4 @@
$this->assertFalse($this->domain->isConfirmed());
$this->assertTrue($this->domain->isVerified());
}
-
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 2, 8:07 PM (9 h, 25 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18820636
Default Alt Text
D1738.1775160450.diff (1 KB)
Attached To
Mode
D1738: Fix UX bug in list input - add input content to the list on submit
Attached
Detach File
Event Timeline