ember-inputmask
ember-inputmask copied to clipboard
Value is not nullified when deleting the value via highlighting
Hi,
I'm using number-input and only when I first open the page and delete the existing value of the field via highlighting it all, then the unmaskedValue is not nullified and remains the same.
Have you ever come accross this issue?
This is how I use the component {{number-input unmaskedValue=minTradeQty.value group=true groupSize=3 separator="." decimal=false radix=","}}
Thanks! Ali
Haven't encountered this before, I'll take a look.
To be clear, you are selecting the contents of the input field and deleting them by pressing delete?
Yep, but it only happens when I'm on an edit page where there is already a value, and I delete it without typing anything.
Same issue here.
So the issue is if the value is prepopulated, you highlight the value with your mouse and hit the "Backspace" key?
@blimmer exactly
Same issue here...
Highlighting full content of field and pressing BACKSPACE/DELETE triggers observer when value property is used:
{{!-- file.hbs --}}
{{phone-number-input value=customerCellPhone}}
/* component.js */
customerCellPhoneChanged: Ember.observer('customerCellPhone', function() {
console.log('customerCellPhoneChanged:', this.get('customerCellPhone'));
})
Same steps above but using unmaskedValue does not trigger observer:
{{!-- file.hbs --}}
{{phone-number-input unmaskedValue=customerCellPhone}}
/* component.js */
customerCellPhoneChanged: Ember.observer('customerCellPhone', function() {
console.log('customerCellPhoneChanged:', this.get('customerCellPhone'));
})
Anyone ever find a work-around for this?
FYI, here's a hack that works:
//components/input-mask.js
keyUp: function() {
this.set('unmaskedValue', this.$().inputmask('unmaskedvalue'));
},
When I try this with one-way-number-mask
, the value is not null but an empty string. Is that better than before?