ui5-webcomponents-react icon indicating copy to clipboard operation
ui5-webcomponents-react copied to clipboard

[FCL + Table]: When a table row action expands the FCL end column, it pushes the opening row out of the visible area

Open lv-sap opened this issue 5 months ago • 1 comments

Describe the bug

Given a UI that contains:

  • FlexibleColumnLayout:
    • startColumn:
      • ObjectPage:
        • Table: // or List
          • TableRows. // or List Items
    • midColumn:
      • Title
      • ... Detail View
Image

Suppose, when the user clicks a TabRow (or List item), the FCL midColumn expands and shows the details view.

Image

Suppose, when the FCL midColumn expands, it pushes the selected TabRow (or List item) down, outside of the FCL visible area.

Image

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.

Image

https://vitejsvitervrtxrln-zz52--5173--5162ecc8.local-credentialless.webcontainer.io/

Isolated Example

No response

Reproduction steps

  1. open https://vitejsvitervrtxrln-zz52--5173--5162ecc8.local-credentialless.webcontainer.io/
  2. scroll down to the last list item and select it
  3. wait for the mid column to expand and the list item to go under the visible area
  4. 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.

lv-sap avatar Jun 16 '26 00:06 lv-sap

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.

Lukas742 avatar Jun 22 '26 06:06 Lukas742

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.

github-actions[bot] avatar Jul 07 '26 02:07 github-actions[bot]

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.

github-actions[bot] avatar Jul 15 '26 02:07 github-actions[bot]

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

lv-sap avatar Sep 04 '26 17:09 lv-sap

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.

Lukas742 avatar Sep 07 '26 07:09 Lukas742

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:

  1. Your rows use wrappingType="Normal", so they re-wrap taller as the column narrows and the row moves down.
  2. The ObjectPage manages 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 plain overflow: auto div 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.

Lukas742 avatar Sep 07 '26 13:09 Lukas742