Closed mloar closed 5 years ago
@mloar There seems to be a typo in the conditional statement that I need to check. But, do you have an example that is causing the issue? Is it when value=null in the template?
In my case I'm binding value to a DS.attr('string') on a model. My backend returns nulls in the JSON, which get passed through the model into the template. Probably not the best design, but hasn't been a problem otherwise.
@mloar Thanks, this is helpful.
@mloar 0.74.17 has the fix.
I am experiencing a similar problem with mdc-textfield 0.78. if i pass a null property to value
(like when a related model has not resolved.
@jamesstaub This is the same problem, but in a different location. It seems that 2.0.0
has made some changes at the foundation level that is not liking null
values.
@jamesstaub Upon further investigation, this is actually a completely different issue altogether. The underlying material-components-web
does not like a null
value. Ideally, the underlying foundation component should check for null
value before trying to set the character count. I am going to submit a patch to material-components-web
to handle this scenario.
In the meantime, I am trying to figure out how to best handle this situation. Not setting the value to null
in the foundation component could lead to unwanted behavior, such as not reseting the input. Translating null
values to an empty string could present a problem if the native input triggers a change event—resulting the bound attribute to convert from null
to an empty string. I will get the latter approach a try and see if this is a viable solution.
0.78.1
patch contains a fix for this problem.
awesome thank you!
The recent change d55fcae introduced a bug where a TypeError will occur in _checkValue if value is null.
if (document.activeElement !== input && value !== undefined && value !== value.value) {