Reputation: 2409
I have a <div contenteditable class="content"> </div>
in my template whose inner HTML is tied to Mongo. When I (dynamically) add a new .content
, I'd like to be able to focus it so that the next thing a user types is entered in the contenteditable div.
However, the .focus()
event doesn't play nicely with Meteor's rerendering; even SO's hacks don't work: The JS executes without error, but the focus event doesn't seem to trigger anything (or, it does but it's immediately overwritten by Meteor's rendering).
My question is: How can I force focus that div
? A plan I considered was setting a tabindex and then artificially tabbing to that element, but I'm hoping to not have to resort to such silliness.
[EDIT] I'm aware of the {{#constant}}
tag, but as far as I can tell, that stops the element from being rerendered at all, which is certainly not what I want.
Upvotes: 0
Views: 292