Support Article
Focus shifts to the top of screen on adding item in Grid layout
SA-49745
Summary
Adding an item in a Grid layout, shifts the focus to the top of the screen. Hence, the user has to scroll to the recently added item for filling the details.
Error Messages
Not Applicable.
Steps to Reproduce
- Add a repeat grid inside a section
- Click the Add Item option in the repeat grid. The item is added at the end of the grid. However, the focus shifts to the top
Root Cause
A defect or configuration issue in the operating environment.
Resolution
Perform the following local-change:
- Add the below code snippet in UserWorkForm:
<script>
function setFocusToSectionDetails()
{
var activeRowIndex=window.Grids.activeGrid.getActiveRowIndex();
var activeRow=window.Grids.activeGrid.getRow(activeRowIndex)[0];
var activeRowDetails=activeRow.nextElementSibling;
activeRowDetails.scrollIntoView();
//row.querySelector("#pyLabel").focus();
activeRow.querySelector("td input[autocomplete]").focus();
}
</script> - Invoke the above function OnClick of Add Item option of repeat grid
Published March 9, 2018 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.