How to focus on a newly created input element in Meteor
Consider this requirement.
In template, there is
a button to insert a blank record into Meteor Collection
a list of input element represented the collection which can edit value of
the record
When I pressed the button, the input element with blank record will be
displayed into html because of Meteor's reactivity. But how to set the
input to be auto-focused when created?
I know maybe setting an ID into session and judging it in rendered fuction
will be a solution. Is there any easier way to implement that?
No comments:
Post a Comment