Skip to content

Commit

Permalink
Fix inputType=number handling, fixes #14
Browse files Browse the repository at this point in the history
  • Loading branch information
bashgeek committed Mar 11, 2024
1 parent d633d81 commit c4027a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions resources/js/components/FormField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,16 @@ export default {
addItem()
{
const item = this.newItem.trim();
if (item && !this.maxReached) {
let item, go_ahead;
if (typeof(this.newItem) === 'number') {
item = this.newItem;
go_ahead = true;
} else {
item = this.newItem.trim();
go_ahead = item !== '';
}
if (go_ahead && !this.maxReached) {
console.log('cool')
this.items.push(item)
this.newItem = ''
Expand Down

0 comments on commit c4027a9

Please sign in to comment.