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

Value is not nullified when deleting the value via highlighting #4

Open
ademirsoy opened this issue Feb 24, 2015 · 9 comments
Open
Labels

Comments

@ademirsoy
Copy link

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

@pzuraq
Copy link
Collaborator

pzuraq commented Feb 25, 2015

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?

@ademirsoy
Copy link
Author

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.

@oswaldoacauan
Copy link

Same issue here.

@blimmer
Copy link
Contributor

blimmer commented Oct 5, 2015

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

@oswaldoacauan
Copy link

@blimmer exactly

@bookergabeurena
Copy link

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

@mattmcginnis
Copy link

Anyone ever find a work-around for this?

@mattmcginnis
Copy link

mattmcginnis commented Oct 31, 2016

FYI, here's a hack that works:

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

@brandynbennett
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants