scrollToHashedElement inconsistent due to page load and loading content #2076
-
Hi community, Magma has a ticket to ensure that # anchors in URLs actually scroll to the parts of the pages where the I have noticed that the scrollToHashedElement inconsistency occurs with the following conditions:
What is odd, is when logging out or debugging the value that is used in the I have tried several approaches:
Nothing was really satisfactory, and so I wanted to know if anyone had any additional insight that could help with this issue? Another thought I had is if CaaS or Marketo fired events when they loaded, we could add some logic to the scroll to wait for those if those blocks are present as they seem to be the main culprits. Please let me know your thoughts, and thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
There are parts that Milo can control for load and parts that it cannot. I would probably advocate that Milo fires an event after footer is visible. There's a small chance there's still content in the middle to load, but you would also have CLS issues (or intersection observers) if that was the case. I think this would get you further than anything else, but it may take too long. You visitors probably scrolls before the event fires. This is an age old problem with dynamic content we assemble in real-time. |
Beta Was this translation helpful? Give feedback.
-
After testing a "post Footer load" scroll, the results were not acceptable for good UX (~3s for cached, ~5s for non-cached). |
Beta Was this translation helpful? Give feedback.
There are parts that Milo can control for load and parts that it cannot.
I would probably advocate that Milo fires an event after footer is visible.
There's a small chance there's still content in the middle to load, but you would also have CLS issues (or intersection observers) if that was the case.
I think this would get you further than anything else, but it may take too long. You visitors probably scrolls before the event fires.
This is an age old problem with dynamic content we assemble in real-time.