Skip to content

Commit

Permalink
Add focus function to parse and number field
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmeister committed Apr 27, 2024
1 parent 3ff2f34 commit 7777ffc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/components/form/base/ENumberField.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<EParseField
ref="input"
:value="value"
:format="format"
:parse="parse"
Expand Down Expand Up @@ -55,6 +56,9 @@ export default {
parse(value) {
return isNaN(parseFloat(value)) || /^\.0*$/.test(value) ? null : parseFloat(value)
},
focus() {
this.$refs.input.focus()
},
},
}
</script>
3 changes: 3 additions & 0 deletions frontend/src/components/form/base/EParseField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ export default {
this.parseError = error
}
},
focus() {
this.$refs.textField.focus()
},
},
}
</script>

0 comments on commit 7777ffc

Please sign in to comment.