Closed ghost closed 9 years ago
I've tried this:
vidom.mountToDom(
document.body,
createNode('textarea').attrs({ value : 123 }));
And have seen this:
What's wrong?
@rickardjanson ?
@dfilatov Sorry. Not home at the moment. Issue occur in Internet Explorer. Older versions. In a few edge cases you have to set it as an attribue value. When I mention that, there are also an issue with type
attribute in IE. I will see later if I can find some references, but for now I suggest have a look in the jQuery source code for valHooks.
updated With webkit browsers there are sometimes an issue too, not sure if fixed in v. 44. I have to check the forums for that to verify.
@dfilatov This is not my computer, but to answer you better. I just remember how we did it before with Internet Exolorer 10. We did'nt cast to string, but used .toString()
to force it to be a string and then set as a property.
Here is a few other issues I remember now:
Windows Web Apps (WWA)
a radio button loose it's state if the name are set.""
as true, while other browsers see true
as it is - true
. Example is how IE see some boolean attributes.I've tried in IE9:
vidom.mountToDom(
document.body,
createNode('textarea').attrs({ value : 123 }));
And everything has worked as expected so I'm closing this issue. If you have certain non-working cases please create separate issues. But please check before whether your case doesn't work.
A textarea's
value
should be set as an HTML attribue not a property. Else it will not accept numbers, and you can't cast to string either.var node = createNode("textarea").attrs({ value: 123 }).renderToDom();
Not fully tested, but seems to be same issues with:
buttons
,checkbox
andradio
Have a look here too see different edge cases:
https://github.com/ractivejs/ractive/tree/dev/src/virtualdom/items/Element/Attribute/prototype/update