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

Changed event is not triggered on pressing enter for default value. #33

Open
neelu-singh opened this issue Sep 1, 2017 · 1 comment

Comments

@neelu-singh
Copy link

neelu-singh commented Sep 1, 2017

Hi, I am facing issue, with enter event on text box for default value. For reference my text box is

<input type="text" class="form-control " data-max="20" data-min="0" data-step="0.1" value="10" data-rule="currency">

and i have bind the "changed" event. It's working fine if changed the value from 10 to 15 and 15 to 16. Now problem is when I changed the text box value from 16 to 10 and pressing enter without loosing the focus changed event is not getting fired.

I have debugged the library and found at line number 96 : this.oldValue is still 10 even i have updated the text box value from 10 to 15 to 16.

Please check and update the library if needed.

Thanks

@neelu-singh neelu-singh changed the title Changed event is not trigger on pressing enter for default value. Changed event is not triggered on pressing enter for default value. Sep 1, 2017
@7iomka
Copy link

7iomka commented Feb 24, 2021

Hi, I am facing issue, with enter event on text box for default value. For reference my text box is

<input type="text" class="form-control " data-max="20" data-min="0" data-step="0.1" value="10" data-rule="currency">

and i have bind the "changed" event. It's working fine if changed the value from 10 to 15 and 15 to 16. Now problem is when I changed the text box value from 16 to 10 and pressing enter without loosing the focus changed event is not getting fired.

I have debugged the library and found at line number 96 : this.oldValue is still 10 even i have updated the text box value from 10 to 15 to 16.

Please check and update the library if needed.

Thanks

Hi @neelu-singh , you found a solution?

UPD:

My workaround:

      'keyup.spinner': $.proxy(function(e) {
        e.preventDefault();
        const elVal = this.$el.val();
        // skip empty input value
        if (elVal) {
          this.value(elVal);
        }
        // always update old value
        this.oldValue = elVal;
      }, this),

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

No branches or pull requests

2 participants