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
Blaze not setting "selected" attribute #3191
Comments
I can confirm this. Same system. Selection works, but doesn´t show in html. |
There does seem to be something funny going on here. Thanks for the repo. First, to clarify: From poking at the repo, I think it doesn't actually matter if the truthy value you use is From a cursory look, it looks like we are setting |
It's true, I confirm this. Same issue in checkboxes and option element. |
I'm running into this now with the latest release of Meteor. I have to select the option twice for the 'selected' to take. Any word if this is getting corrected in the next update? |
+1, I'm also having this issue. It's preventing me from canceling a select change reactively, I think, unless I'm missing something. E.g. on select change, fire confirm dialog, if cancel, change select back to what it was - and my "isSelected" template helper is re-running properly, but the select doesn't go back to the previous value, I think because Blaze isn't setting the "selected" attribute in the HTML. |
+1 Same issue here. I can't set the default selected item in a dropdown list because of this. |
@jbrozena22 Have you tried this:
That's Jade BTW, sorry about that. But what you basically want is:
... I think. I think I remember trying |
+ 1 |
+1 |
Any updates on this? |
This format works for me
Where |
I've just run into a similar issue and the workaround from @hitchcott seems to have fixed it. |
Also running into this issue and @hitchcott's solution is working as well. |
Solution from @hitchcott doesn't work for me. Blaze doesn't seem to render any selected attribute I set, even if hardcoded. Very strange. |
Moved to meteor/blaze#210 - closing here - thanks! |
@iwoj Same here... |
In order to avoid conversation getting lost, please continue additional discussion on the new issue within the Blaze repo. |
This has been fixed in See this comment for more information. |
_3 Upvotes_ See this repo and this demo.
Basically passing in an empty string to a
selected
attribute isn't working correctly. When setting multiple attributes as an object, e.g.The selected attribute doesn't turn up at all.
When setting the selected attribute explicitly, the correct
option
is selected (verified by getting the value on theselect
element), but the option that's supposed to be selected still doesn't actually have aselected
attribute.This does not follow the behavior as documented in the Spacebars README, the Meteor manual, or the wiki article on using Blaze.
I've tested this on OS X 10.10 and 10.9 using Safari, Firefox, and Chrome, and iOS 7 and 8.
The text was updated successfully, but these errors were encountered: