[PAGES-970] Editing or creating a new component jumps to the top of the page sometimes Created: 12/Dec/22 Updated: 24/Feb/23 Resolved: 15/Feb/23 |
|
| Status: | Closed |
| Project: | Magnolia pages module |
| Component/s: | Editor Widget |
| Affects Version/s: | 6.2.24 |
| Fix Version/s: | 6.3.0, 6.2.25 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Roberto Gaona | Assignee: | Thuy To |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Σ Remaining Estimate: | 0d | Remaining Estimate: | 0d |
| Σ Time Spent: | 7d 2.25h | Time Spent: | 7d 2.25h |
| Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
| Issue Links: |
|
||||||||||||||||||||||||||||
| Sub-Tasks: |
|
||||||||||||||||||||||||||||
| Template: | |||||||||||||||||||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||||||||||||||||||
| Task DoD: |
[X]*
Doc/release notes changes? Comment present?
[X]*
Downstream builds green?
[X]*
Solution information and context easily available?
[X]*
Tests
[X]*
FixVersion filled and not yet released
[X] 
Architecture Decision Record (ADR)
|
||||||||||||||||||||||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||||||||||||||||||||||
| Release notes required: |
Yes
|
||||||||||||||||||||||||||||
| Date of First Response: | |||||||||||||||||||||||||||||
| Epic Link: | AuthorX Support | ||||||||||||||||||||||||||||
| Sprint: | AuthX 27, AuthX 28 | ||||||||||||||||||||||||||||
| Story Points: | 3 | ||||||||||||||||||||||||||||
| Team: | |||||||||||||||||||||||||||||
| Work Started: | |||||||||||||||||||||||||||||
| Description |
Steps to reproduceThis behaviour can be reproduced on the demo page by doing the following:
Expected resultsAs on the first created component, remaining on the newly created element would be the expected result. Actual resultsOn the second created component (and subsequents) the view on the iframe is reset to being at the top of the screen. Additional notesThis behavior, jumping to the top of the page, actually happens with several actions:
We should test all scenarios to ensure the behaviour is consistent for the authors WorkaroundDevelopment notes
<script type="module" src="https://cms-components.dev.fe.union-investment.de/test_UMAGDXC-2631-magnolia-test-web-component/union-investment-cms-components/union-investment-cms-components.esm.js"> <ui-cms-test-component delay='5000' pixel='500'><p>Here is some Text</p></ui-cms-test-component>
|
| Comments |
| Comment by Christopher Chard [ 11/Jan/23 ] |
|
Hi rgaona, |
| Comment by Laura Delnevo [ 11/Jan/23 ] |
|
Hey cchard, Laura here. Thanks for the ping. This is not our highest priority atm. The team if focusing on some Campaign Publisher issues for Support during the next sprint. But let me see, if I can maybe get someone to look at it in the first half of Feb. If nothing more urgent comes in, I will keep this request in mind. |
| Comment by Marvin Kerkhoff [ 11/Jan/23 ] |
[#if cmsfn.isEditMode()] <script> function elementReady(selector) { return new Promise((resolve, reject) => { let el = document.querySelector(selector); if (el) {resolve(el);} new MutationObserver((mutationRecords, observer) => { // Query for elements matching the specified selector Array.from(document.querySelectorAll(selector)).forEach((element) => { resolve(element); //Once we have resolved we don't need the observer anymore. observer.disconnect(); }); }) .observe(document.documentElement, { childList: true, subtree: true }); }); } elementReady('.mgnlEditorBar.mgnlEditor.component.focus').then((someWidget)=>{someWidget.scrollIntoView(); }); </script> [/#if] This should probably help, but it's a workaround not a completed solution. |
| Comment by Carlos Cantalapiedra [ 07/Feb/23 ] |
|
A simple way to reproduce it is to create a new component at the bottom of the page (e.g, at https://demoauthor.magnolia-cms.com/.magnolia/admincentral#app:pages-app:detail;/sportstation/about:edit). Once you save it, you are moved to the top. But if you edit that very same component, then it keeps you one the proper location. So looks like creating a component push you to the top while duplicating / editing keeps you one the correct scroll location. |