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

Input don't update if value changed to "undefined" #2082

Closed
ftaiolivista opened this issue Feb 6, 2018 · 4 comments
Closed

Input don't update if value changed to "undefined" #2082

ftaiolivista opened this issue Feb 6, 2018 · 4 comments

Comments

@ftaiolivista
Copy link
Contributor

@ftaiolivista ftaiolivista commented Feb 6, 2018

I have an input text field binded to a variable.
If I change the variable, after redraw I see the input content change.
But if I change the variable to "undefined" the input content don't change.

Expected Behavior

I expect the input content to become empty

Current Behavior

The redraw of input field seems to ignore the value change if the new value == undefined

Steps to Reproduce (for bugs)

Write on input field, click "save" to reset. (the input don't reset)
https://jsfiddle.net/hphg5ca2/12/

Your Environment

@pygy
Copy link
Member

@pygy pygy commented Feb 7, 2018

Hi @ftaiolivista this is actually a dupe of #1804. There's a tentative fix in #1865 but IIRC there was more to it but I never got around to finish it. So many thanks for #2088.

@ftaiolivista
Copy link
Contributor Author

@ftaiolivista ftaiolivista commented Feb 8, 2018

Hi @pygy. I hope the fix is good. I'm not really in deep on Mithril but looking at the code (that @isiahmeadows pointed me to) I think the change will not break other things. I'm using the patched version in my project without incourring in problems.

@isiahmeadows
Copy link
Member

@isiahmeadows isiahmeadows commented Feb 8, 2018

@pygy Should we just go ahead and accept this hot-fix for now? (I've just approved the PR)

@pygy
Copy link
Member

@pygy pygy commented Feb 8, 2018

Merged!

@pygy pygy closed this Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants