-
Notifications
You must be signed in to change notification settings - Fork 65
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
Cant clear an input value #66
Comments
Looking at the tests this is expected behavior for a reason- but can probably be handled.
But I suspect the reason is: if in the yo-yo dom string, there is nothing bound to input's value and nothing bound to I think the best route would be to check then if that element has something bound to onchange or oninput event. If there is a handler bound, then the value must be explicitly updated. Otherwise the input can copy over the value as normal. |
I am also running into this issue, but do not have handlers on the // (from main.js)
if ((f.nodeName === 'INPUT' && f.type !== 'file') || f.nodeName === 'SELECT') {
if (t.getAttribute('value') === null) {
t.value = f.value;
}
else {
f.value = t.value;
}
} else… Which is somewhere in between what this originally did and the change that led to current behavior: 893b779 |
FWIW, the |
I like the above idea. Though since morphdom is being used under the hood- it doesn't appear to be a requirement that the compared node even have the
It also specifies the vnode should have So I suppose |
Oh, yeah, totally forgot nodes created outside the browser won’t be full DOM nodes. If they support |
Hey, is there any update with this? We're finding a few areas of our app where we're wanting to clear inputs (search inputs etc). Happy to lend a hand if there's anything blocking. |
fixed? :) |
the codepen linked in the original post for this issue (https://codepen.io/anon/pen/jyapVW?editors=1010) seems to run as expected with the latest version of should this issue be closed ? |
#71 would address this if there's
still an issue. Alternatively it might be useful to use `bel` and
`nanomorph` directly. Would be neat to merge that, and push a major (:
…On Wed, Sep 13, 2017 at 10:17 AM Stephane Catala ***@***.***> wrote:
the codepen linked in the original post for this issue (
https://codepen.io/anon/pen/jyapVW?editors=1010) seems to run as expected
with the latest version of yo-yo, i.e. user input is cleared when the
code sets the value attribute of the <input> tag to an empty string.
should this issue be closed ?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#66 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACWleg_shhry--8j43PuWIFrL2WpXsBJks5sh4-WgaJpZM4LwkTI>
.
|
The core issue I was encountering certainly seems to be fixed. I can’t say whether it practically does so because the project I encountered it in was using Choo, which switched to Bel before the updated release of Yo-yo. |
Demo: https://codepen.io/anon/pen/jyapVW?editors=1010
If the user enters a value into an input, and then you use yo to set the value to '', the change doesn't occur. How can we clear the value via yo?
The text was updated successfully, but these errors were encountered: