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

Password value binding triggers updateTarget? #458

Open
jods4 opened this issue Jul 21, 2016 · 11 comments
Open

Password value binding triggers updateTarget? #458

jods4 opened this issue Jul 21, 2016 · 11 comments
Labels

Comments

@jods4
Copy link
Contributor

jods4 commented Jul 21, 2016

I am observing a strange beahvior that is causing me trouble.

I have a simple value binding + behavior on a password field:
<input type=password value.bind="p & validate" />.

When I type text in the input, I see updateSource is called, as expect.
When I mash keys -- or simply press two keys at the same time -- it seems updateTarget is called as well. But why? This is causing unwanted side-effects in my binding behavior.

This is easy to reproduce in IE11 with a password box: just hit two keys at the same time.
It seems it sometimes happens with a normal textbox as well, but it is a lot harder to reproduce.

@jdanyow
Copy link
Contributor

jdanyow commented Jul 21, 2016

does it happen in other browsers too? Whats the call stack? Can you provide a plunker?

@jods4
Copy link
Contributor Author

jods4 commented Jul 21, 2016

It does easily happen in Edge as well. Does not seem to happen on Firefox. Untested in Chrome.

Here's a plunker: https://plnkr.co/9cF0XO8FjPK6relatTf5

There's one updateTarget at startup, which is probably because I did not define x on the model, so it gets updated from undefined to "" (I guess).

But then if you hit two keys at the same time, you very easily get a updateTarget on IE11 and Edge.

As for the callstack, I would like to take the opportunity to say that the TaskQueue makes it often quite hard to track causality. All the bindings are updated in this micro-queue... I wonder if there is a way to opt-in long stack traces like built-in async callbacks do in the Edge debugger callstack.

@jdanyow
Copy link
Contributor

jdanyow commented Jul 23, 2016

I see it happening in edge too. not in chrome, firefox or IE11.

https://plnkr.co/edit/ahRwzTeRjFeCYKUs0U1c?p=preview

@jods4
Copy link
Contributor Author

jods4 commented Jul 23, 2016

@jdanyow Good that you can reproduce it!
I experienced it first on IE11, not sure why you don't.

Any idea where it comes from?

@jdanyow
Copy link
Contributor

jdanyow commented Jul 23, 2016

No, not yet. I also looked at adding a "long stack traces" plugin for the TaskQueue to help with the debugging thing you mentioned.

@huw489
Copy link

huw489 commented Dec 8, 2016

Did you ever find a fix for this? I'm experiencing the same problem; I've narrowed it down to Binding.prototype.call in Aurelia-binding.js.
what I'm seeing is that in Chrome when pressing two keys at once in a textarea input that when getting the value from the textarea it only includes the first key typed, but in IE11 it shows both keys - hence it executes the code if (newValue !== oldValue).
I hope that makes sense.
I came across this from users telling me the cursor always jumped to the end of their text if they moved back into the text and typed quickly.

@EisenbergEffect
Copy link
Contributor

@jdanyow Putting this back on your radar.

@Alexander-Taran
Copy link
Contributor

Stale since 2016

@EisenbergEffect
Copy link
Contributor

@jdanyow Can you comment?

@Alexander-Taran
Copy link
Contributor

or @jods4 ? (-:

@jods4
Copy link
Contributor Author

jods4 commented Jan 8, 2019

@Alexander-Taran
Unfortunately the plunker is gone but I think the description of the problem is clear?

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

5 participants