[FCL + Table]: When a table row action expands the FCL end column, it pushes the opening row out of the visible area
Describe the bug
Given a UI that contains:
- FlexibleColumnLayout:
- startColumn:
- ObjectPage:
- Table: // or List
- TableRows. // or List Items
- Table: // or List
- ObjectPage:
- midColumn:
- Title
- ... Detail View
- startColumn:
Suppose, when the user clicks a TabRow (or List item), the FCL midColumn expands and shows the details view.
Suppose, when the FCL midColumn expands, it pushes the selected TabRow (or List item) down, outside of the FCL visible area.
When the user closes the midColumn (form the top X button) the previously selected TabRow (or List item), which expanded the midColumn, does not scroll back into the visible area.
https://vitejsvitervrtxrln-zz52--5173--5162ecc8.local-credentialless.webcontainer.io/
Isolated Example
No response
Reproduction steps
- open https://vitejsvitervrtxrln-zz52--5173--5162ecc8.local-credentialless.webcontainer.io/
- scroll down to the last list item and select it
- wait for the mid column to expand and the list item to go under the visible area
- close the mid column
Issue: the selected list item does not scroll back into the view
Expected Behaviour
The selected list item to Table row, which when clicked, expanded the mid column, to scroll back into the view after the mis column is closed.
Screenshots or Videos
No response
UI5 Web Components for React Version
v2
UI5 Web Components Version
v2
Browser
Chrome
Operating System
No response
Additional Context
No response
Relevant log output
Organization
No response
Declaration
- [x] I’m not disclosing any internal or sensitive information.
Hi @lv-sap
thanks for reporting! The provided link for the reproducible example doesn't connect to any StackBlitz project. Please share the full Stackblitz link, so we can take a look at the implementation.
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Inactive issues will be closed after 7 days. Thanks.
Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please first check to see if the maintainers have requested additional input and provide it if necessary, or post a detailed description of why this issue is still a problem.
I see it's closed, but the bug still exists. See https://stackblitz.com/edit/vitejs-vite-rvrtxrln?file=tsconfig.app.json,package.json,tsconfig.json,tsconfig.node.json,vite.config.ts,src%2FApp.tsx
Hi @lv-sap
The issue was closed because you were asked to provide a working reproduction example and didn't respond. This is stated in my comment and the two bot comments above. If the required information is provided sooner, we can avoid closing issues like this in the future. Stale issues will automatically be closed after one month without reply.
Reopening, as a working StackBlitz link has now been provided.
Hi @lv-sap
The FlexibleColumnLayout has no scroll logic of its own; what matters is the scroll container in the first column.
In your setup that column is an ObjectPage, and two things hide the selected row when the mid column expands:
- Your rows use
wrappingType="Normal", so they re-wrap taller as the column narrows and the row moves down. - The
ObjectPagemanages its own scroll container and re-asserts its position for ~1s after a reflow, so it doesn't restore the row on collapse the way a plainoverflow: autodiv would.
Recommended fix: use the intended floorplan. ObjectPage is meant to be the detail view, not the master column. Put a List Report (List with standard ListItemStandard rows) in the first column and the ObjectPage in the detail column. Fixed-height rows keep their scroll offset across open/close, so nothing gets hidden. See the SAP Fiori Design Guidelines: Flexible Column Layout, List Report, Object Page.
Live example (recommended pattern): https://stackblitz.com/edit/github-vuhtqqme?file=src%2FApp.tsx
If you must keep ObjectPage as the master column, force the row back on close. Since the ObjectPage re-asserts its scroll for ~1s, a one-shot scrollIntoView gets overridden, so re-apply it across the settle window:
const onClose = () => {
setLayout(FCLLayout.OneColumn);
const target = selectedItemRef.current; // the <li> from onItemClick (e.detail.item)
if (target) {
target.focus(); // returns focus and scrolls into view once
const start = performance.now();
const pin = () => {
target.scrollIntoView({ block: 'center' });
if (performance.now() - start < 1200) {
requestAnimationFrame(pin);
}
};
requestAnimationFrame(pin);
}
};
Live example (workaround): https://stackblitz.com/edit/github-u4qswdmb?file=src%2FApp.tsx
Both examples also wire up focus: on open, focus the detail's close button (in the intended version a ToolbarButton, whose focus() delegates to the rendered button, deferred one frame so it wins against the ObjectPage's mount-time handling); on close, focus returns to the selected row.
I'll close this for now, but feel free to comment if anything is unclear or doesn't work, and we'll reopen it.