You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a modal with a set of headings and copy. It has been styled so the modal content is scrollable. This all works fine, but it has been requested that the modal scroll to specific sections when opened. This seems straightforward enough, but I find I am unable to set the scroll position of any element inside of a modal because of ember-wormhole. Here is a brief outline of the implementation:
{{#if isShowingModal}}
{{#modal-dialog}}
...
The action that toggles the value is set up as follows:
toggleModal(shouldScroll) {
this.toggleProperty('isShowingModal');
scheduleOnce('afterRender', () => {
if(shouldScroll) {
// query the appropriate element in the modal DOM and set scroll
...
The code executes as expected, but... ember-wormhole also uses an afterRender hook to call _appendToDestination (this is in the init hook). _appendToDestination steps through the child nodes of the modal and calls insertBefore, reinserting each into its parent node. This "refresh" of the DOM resets the scroll position, undoing the scroll position set in my code.
How can I execute code after the dialog is opened and ember-wormhole has finished?
Is there a way to ensure my afterRender fires after ember-wormhole finishes its work?
Is there another way around this?
The text was updated successfully, but these errors were encountered:
I have a modal with a set of headings and copy. It has been styled so the modal content is scrollable. This all works fine, but it has been requested that the modal scroll to specific sections when opened. This seems straightforward enough, but I find I am unable to set the scroll position of any element inside of a modal because of ember-wormhole. Here is a brief outline of the implementation:
The action that toggles the value is set up as follows:
The code executes as expected, but... ember-wormhole also uses an
afterRender
hook to call_appendToDestination
(this is in theinit
hook)._appendToDestination
steps through the child nodes of the modal and callsinsertBefore
, reinserting each into its parent node. This "refresh" of the DOM resets the scroll position, undoing the scroll position set in my code.How can I execute code after the dialog is opened and ember-wormhole has finished?
Is there a way to ensure my
afterRender
fires after ember-wormhole finishes its work?Is there another way around this?
The text was updated successfully, but these errors were encountered: