ember-inputmask icon indicating copy to clipboard operation
ember-inputmask copied to clipboard

Value is not nullified when deleting the value via highlighting

Open ademirsoy opened this issue 10 years ago • 9 comments

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

ademirsoy avatar Feb 24 '15 10:02 ademirsoy

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?

pzuraq avatar Feb 25 '15 15:02 pzuraq

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.

ademirsoy avatar Feb 25 '15 15:02 ademirsoy

Same issue here.

oswaldoacauan avatar Oct 05 '15 18:10 oswaldoacauan

So the issue is if the value is prepopulated, you highlight the value with your mouse and hit the "Backspace" key?

blimmer avatar Oct 05 '15 19:10 blimmer

@blimmer exactly

oswaldoacauan avatar Oct 05 '15 19:10 oswaldoacauan

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'));
})

bookergabeurena avatar Jan 07 '16 17:01 bookergabeurena

Anyone ever find a work-around for this?

mattmcginnis avatar Oct 31 '16 22:10 mattmcginnis

FYI, here's a hack that works:

    //components/input-mask.js
    keyUp: function() {
      this.set('unmaskedValue', this.$().inputmask('unmaskedvalue'));
    },

mattmcginnis avatar Oct 31 '16 23:10 mattmcginnis

When I try this with one-way-number-mask, the value is not null but an empty string. Is that better than before?

brandynbennett avatar Jan 30 '19 04:01 brandynbennett