Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
fix: do not reset inputcurrency to improve UX (#909)
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsANameToo committed Dec 31, 2018
1 parent 0677b60 commit 7f2963a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/renderer/components/Input/InputCurrency.vue
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,11 @@ export default {
*/
updateInputValue (value) {
// Ignore invalid values
if (!value || this.checkAmount(value)) {
if (value && this.checkAmount(value)) {
let number = Number(value.toString().replace(',', '.'))
number.toString().includes('-')
? this.inputValue = number.toFixed(number.toString().split('-')[1]) // Small numbers will be like 1e-7 so we use the number after '-' for toFixed()
: this.inputValue = value ? value.toString().replace(',', '.') : ''
: this.inputValue = value.toString().replace(',', '.')
// Inform Vuelidate that the value changed
this.$v.model.$touch()
return true
Expand Down

0 comments on commit 7f2963a

Please sign in to comment.