Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<v-text-field> mask doesn't work when combined with .number modifier #2137

Closed
brenogazzola opened this issue Oct 11, 2017 · 1 comment
Closed
Assignees
Labels
T: bug Functionality that does not work as intended/expected

Comments

@brenogazzola
Copy link

Steps to reproduce

  1. Create a v-text-field with the mask "##.##" and set the .number modifier to its v-model.
  2. Type '1234' on the text field.

Versions

0.16.4

What is expected ?

The text field should display '12.34'

What is actually happening ?

The text field is not formatted and the console in devtools shows errors.

Reproduction Link

https://codepen.io/bspg/pen/aLKybz

@KaelWD KaelWD added the T: bug Functionality that does not work as intended/expected label Oct 11, 2017
@KaelWD KaelWD self-assigned this Oct 11, 2017
@KaelWD KaelWD closed this as completed in c57336b Oct 11, 2017
azaars added a commit to azaars/vuetify that referenced this issue Oct 11, 2017
- Dev should be allowed to set input to null and expect v-model to
  retain the null value. Requesting a reconsideration against returning
a string as in commit 95b7f83

- Handle v-model.number modifier correctly. Whether the input is string,
  number or null, the resulting emit() should return the same type or
null. Requesting this as an alternative to resolve vuetifyjs#2137.

- Handle input of type number. Likewise, the resulting emit() should
  return the same type. Requesting this as an alternative to resolve vuetifyjs#2136.
johnleider pushed a commit that referenced this issue Oct 18, 2017
* Bug fixes on v-text-field
1. Resolves #2057
2. Resolves #2096
3. Resolves #2097

* Make way for props.clearable=true

* Removes unneeded sanity check.

* null check on externally set value

* Add conditional setSelectionRange() & anticipate valid null value.

* Allow null value & v-model.number config + handle input of type number

- Dev should be allowed to set input to null and expect v-model to
  retain the null value. Requesting a reconsideration against returning
a string as in commit 95b7f83

- Handle v-model.number modifier correctly. Whether the input is string,
  number or null, the resulting emit() should return the same type or
null. Requesting this as an alternative to resolve #2137.

- Handle input of type number. Likewise, the resulting emit() should
  return the same type. Requesting this as an alternative to resolve #2136.

* Clean up codes involving conditional mask

Fix #2158

* Removes redundant check on oldValue (input.value)

* Removes useless getLazyValue()

* Post-review updates & fixes
- Revert to last commit to undo unnecessary changes
- Fix computed.inputValue to account for type of emitted value
- Enhance watch.value to check for external/internal change
- Prevent resetSelections() from causing runtime error when
  type="number'
- Fix multiple emits bug
- Minor change to local variable names to be consistent between
  functions
@lock
Copy link

lock bot commented Apr 15, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please direct any non-bug questions to our Discord

@lock lock bot locked as resolved and limited conversation to collaborators Apr 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

No branches or pull requests

2 participants