-
Notifications
You must be signed in to change notification settings - Fork 15
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
after render hook? #4
Comments
What's the use case? Rendering is synchronous. |
sorry premature submit, read above. async rendering is another issue i will open later :), like returning a |
perhaps use the same strategy as EDIT: if this callback fires on both initial render and refresh, probably passing in |
another use-case is setting another is setting a form element's focus. |
In dombuilder (the previous generation to domchanger), I had a special I vaguely remember something being done here, but can't find it. The raw "el" node type was added when I was using codemirror in an app. (See http://desktop.creationix.com/ and https://github.com/creationix/tedit/blob/master/src-minimal/ui/code-mirror-editor.js#L18-L31) |
coincedentally, i'm writing a toy in-browser IDE with tabbed nav, session restore, status bar and codemirror to test domchanger. this involves restoring codemirror selections, cursor pos, history state. file contents are loaded async from the server, so a way to do deferred render via Promises will need to be figured out. a per-element afterRender(el, isInitial) callback would be ideal, but a single callback at component level would be okay too...maybe even both. |
I think this I'm still not sure why domchanger should have to know anything about the promises for fetching your data. Simply call refresh or emit an event when your promise finally gets fulfilled. |
yes, this works well. i think EDIT: i may be missing something here, so please clarify if any of this is incorrect |
i do think that having an |
I have wished a few times that the component had some sort of initialization parameters apart from the render data. I'll have to think about to fit this in. |
Hi,
How would you suggest to handle a case when you need to interact programatically with an element or component after it is rendered. For example rendering a
<textarea>
with a value and setting the cursor position or selection range within it after it has been rendered?Is there a post-render hook that provides a reference to the element's node to allow for this?
thanks!
The text was updated successfully, but these errors were encountered: