-
Notifications
You must be signed in to change notification settings - Fork 254
fixes textfield not being updated if it received dynamically a value #79
Conversation
Still to avoid setting value twice we should not pass argument to |
fc395a7
to
67cbc57
Compare
So I updated the code to only force a |
I don't think we need these checks actually :-) Just leaving it with no argument will be ok. Take a look at these lines https://github.com/tleunen/react-mdl/blob/master/extra/material.js#L2637-L2639 So if we don't pass a value it just updates classes. |
Even better, upstream code checks if there's need to add/remove classes, so even |
Yes, it would work, but only with the current version that we have in react-mdl. Upstream, the code has changed to fix an issue and now it supports to pass an empty string. |
Even with that in mind I don't that we should use contains to detect if it's focused, it's better to use ref and just check equality then :-) But don't close this yet, I'd like to test if setting value twice will have any impact on performance. |
67cbc57
to
9277af1
Compare
👍 used ref instead to avoid searching inside the entire element. |
9277af1
to
6e69066
Compare
fixes textfield not being updated if it received dynamically a value
Could you publish that to npm before we introduce breaking changes? |
There are already too many changes and breaking changes, so I was planning to finish them before releasing a new version |
Related to #58.
If the textfield receives dynamically a value, without directly through the input from a user, the textfield wasn't updated properly (the floating label/css classes were not updated).
By forcing to change the value with the MDL upstream
change
function, it resolves the issue.