[MGNLUI-8154] When I open a story, it scrolls down the bottom of the page Created: 09/May/23  Updated: 28/Jul/23  Resolved: 28/Jul/23

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0, 6.2.38

Type: Bug Priority: Neutral
Reporter: Laura Delnevo Assignee: Quach Hao Thien
Resolution: Fixed Votes: 0
Labels: VN-Analysis, VN-Maintenance
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: 4d 3h Time Spent: 4d 3h
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: File Admincentral.webm    
Issue Links:
Problem/Incident
causality
caused by MGNLUI-6955 Switching Languages On Dialogs Change... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLUI-8210 Implementation Sub-task Completed Quach Hao Thien  
MGNLUI-8211 Review Sub-task Completed Jaromir Sarf  
MGNLUI-8212 PreintQA Sub-task Closed Antonín Juran  
MGNLUI-8213 QA Sub-task Completed Jaromir Sarf  
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
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: Maintenance of vaadin8 framework
Sprint: Nucleus 41
Story Points: 5
Team: Nucleus
Work Started:
Approved:
Yes

 Description   

Steps to reproduce

  1. Go to stories ap
  2. Open an existing story
  3. The screen scrolls down to a random place at the bottom of the story

Expected results

The screen stays at the top of the story

Actual results

The screen scrolls down to a random place at the bottom of the page

Workaround

Development notes

As discovery, this issue is a side effect of this PR https://git.magnolia-cms.com/projects/PLATFORM/repos/ui/pull-requests/2264/overview 



 Comments   
Comment by Roman Kovařík [ 10/May/23 ]

Could SUPPORT-16391 be the same issue?

Comment by Thuy To [ 03/Jul/23 ]

Discovery:

This happened from Mag 6.2.7 which was impacted by issues fixed on UI  https://git.magnolia-cms.com/projects/PLATFORM/repos/ui/pull-requests/2264/overview 

 

Comment by Quach Hao Thien [ 11/Jul/23 ]

Discovery

The issue happens on the MultiFormView like MultiBlockView or MultiLinkFormView, which contain multiple field containers and every field container has its own field index system. And the code which causes the issue: 

 

private JsArray<Element> getFieldCaptions(Widget widget) {
        return JQueryWrapper
                .select(widget) <<< HERE
                .find(".v-formlayout-captioncell .v-caption")
                .get();
    } 

The method above aims to return all the field captions within the widget (or container). By scoping only to the widget, there is only a limited number of field captions are returned, not all the field captions of the form are as expected.

Propose solution

Instead of a query that finds the field captions within the widget, the query should find from the top container of the form, e.g: 

private JsArray<Element> getFieldCaptions(Widget widget) {
    Widget topParent = getTopParentOf(widget);
    return JQueryWrapper
                .select(topParent)
                .find(".v-formlayout-captioncell .v-caption")
                .get();
} 

Potential issues:

 

private Element getInputFieldByIndex(Widget widget, int fieldIndex) {
    JsArray<Element> elements = getFieldCaptions(widget);        
    Element element = elements.length() > fieldIndex ? elements.get(fieldIndex) : elements.get(0); <<< HERE
    Element controlContainer = getControlByLabel(element);         
    JsArray<Element> nestedInputs = getNestedInputs(controlContainer);          
    //Only get the first input field
    return nestedInputs.get(0);
} 

 

private JsArray<Element> getNestedInputs(Element controlContainer) {
        return JQueryWrapper
                .select(controlContainer)
                .find("textarea, input[type]:not([type=search]):not([type=url]):not([type=hidden])")
                .get();
    } 

 

Generated at Mon Feb 12 09:52:37 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.