Skip to content

Commit

Permalink
Prevent setting unchanged value of input on blur (#3077)
Browse files Browse the repository at this point in the history
Fix #3029
Force setting the value actually resets selectionStart and selectionEnd
No test is added because you cannot simulate the bug by using
input.blur()
  • Loading branch information
posva authored and yyx990803 committed Jun 14, 2016
1 parent 83d37b0 commit ab67578
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/directives/public/model/text.js
Expand Up @@ -129,7 +129,10 @@ export default {
},

update (value) {
this.el.value = _toString(value)
// #3029 only update when the value changes. This prevent
// browsers from overwriting values like selectionStart
value = _toString(value)
if (value !== this.el.value) this.el.value = value
},

unbind () {
Expand Down

0 comments on commit ab67578

Please sign in to comment.