Skip to content

[FilterBar]: Adapt Filters dialog unusable when working with compat Table #7314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
Na1k opened this issue May 8, 2025 · 12 comments · May be fixed by #7341
Open
1 task done

[FilterBar]: Adapt Filters dialog unusable when working with compat Table #7314

Na1k opened this issue May 8, 2025 · 12 comments · May be fixed by #7341

Comments

@Na1k
Copy link

Na1k commented May 8, 2025

Describe the bug

When rendering a FilterDialog in a project that uses the Table component of the webcomponents-react-compat package, the dialog content is malformed. I assume this is because the FilterBar uses the (experimental) v2 Table under the hood, leading to conflicts.

Did I miss anything? Is there any workaround?

Isolated Example

https://stackblitz.com/edit/github-z74gvby1?file=src%2FApp.tsx

Reproduction steps

  1. Use the Table from the compat package
  2. Implement a FilterBar
  3. Click on the "Adapt Filters" button to open the dialog

Expected Behaviour

The FilterBar dialog shows the content correctly, regardless of the used Table component that is used in the app.

Screenshots or Videos

No response

UI5 Web Components for React Version

2.9.0

UI5 Web Components Version

2.9.0

Browser

Chrome

Operating System

MacOS

Additional Context

No response

Relevant log output

Organization

No response

Declaration

  • I’m not disclosing any internal or sensitive information.
@Lukas742
Copy link
Contributor

Lukas742 commented May 12, 2025

Hi @Na1k

just a quick update — we're actively working on this topic. Unfortunately, it's not straightforward, as ensuring the tag name changes at the right time is tricky, especially in dev-mode. We'll keep you posted once we have further updates.

Is there a specific reason, why you can't update to the V2 table?

@Lukas742
Copy link
Contributor

Lukas742 commented May 14, 2025

Hi @Na1k

we just released a snapshot that adds a new command to our cli package patching the v1 (compat) table. You can find out how to use it here: https://github.com/SAP/ui5-webcomponents-react/blob/feat/cli-patch-table/packages/compat/README.md#using-the-script

This is the snapshot version: 0.0.0-8aacff3422

To test it:

  • Update or install @ui5/webcomponents-react-cli and use the snapshot version
  • Update all remaining @ui5/webcomponents... packages to 2.10.0

Could you please try out the script and let us know if it solved the issue in your application or if you faced issues? Thanks in advance!

Unfortunately, we didn't find a better way to enable this across different implementations and environments.

@Na1k
Copy link
Author

Na1k commented May 14, 2025

Hi @Lukas742,

Thanks for the update! I'll try it out first thing tomorrow morning and let you know.

Adding a patch is not great, but might help us to migrate to v2 and the v2 Table afterwards.

Is there a specific reason, why you can't update to the V2 table?

The reason why we don't want to migrate to the v2 Table right now is simple. It's marked as experimental + we have a large code base to migrate so we need to do the migration to ui5 v2 as step-wise as possible.

@Lukas742
Copy link
Contributor

Lukas742 commented May 14, 2025

Thanks @Na1k!

The reason why we don't want to migrate to the v2 Table right now is simple. It's marked as experimental + we have a large code base to migrate so we need to do the migration to ui5 v2 as step-wise as possible.

Understandable, but according to this comment, the table will become stable in Q2, so migrating should soon be possible :)

@Na1k
Copy link
Author

Na1k commented May 15, 2025

@Lukas742 That's good news! I wasn't aware of that, thanks.

I tried to get the application running with the patches you provided. First things first, the adapt filters dialog table now looks as expected. But the compat table does not display any rows. Instead, for each row to display the following error is thrown and displayed in the console:

TableRow.js:255 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length')
    at TableRow.js:255:1
    at Array.map (<anonymous>)
    at get ariaLabelText (TableRow.js:253:1)
    at TableRow.TableRowTemplate (TableRowTemplate.js:4:57)
    at executeTemplate (executeTemplate.js:9:1)
    at TableRow.render (UI5Element.js:164:31)
    at TableRow.jsxRenderer (JsxRenderer.js:12:1)
    at updateShadowRoot (updateShadowRoot.js:14:1)
    at TableRow._render (UI5Element.js:668:29)
    at renderImmediately (Render.js:31:1)

TableRow.js

get ariaLabelText() {
    const isSelected = this.selected ? TableRow_1.i18nBundle.getText(LIST_ITEM_SELECTED) : TableRow_1.i18nBundle.getText(LIST_ITEM_NOT_SELECTED);
    const isRowSelectable = this.isSingleSelect || this.isMultiSelect;
    const ariaLabel = this.cells.map((cell, index) => {
        const columText = this.getColumnTextByIdx(index);
        const cellText = cell.cellContent.length ? this.getCellText(cell) : cell.ariaLabelEmptyCellText; <--- This where the error is thrown
        return `${columText} ${cellText}`;
    }).join(" ");
    if (isRowSelectable) {
        return `${ariaLabel}. ${this.forcedAriaPosition}. ${isSelected}`;
    }
    return `${ariaLabel}. ${this.forcedAriaPosition}`;
}

In addition to that, there is a console.log statement printing "hello" somewhere.
I guess it's related to the last line in your patch: https://github.com/SAP/ui5-webcomponents-react/pull/7341/files#diff-7dc51f673a263bf1dab08e3edaafd1f454371b27f1119519de8272da9605b6f4

@Lukas742
Copy link
Contributor

@Na1k Thank you for testing!

I tried to reproduce the error but wasn't able to. Could you take a look at this StackBlitz example and let me know if I need to adjust something to trigger the error?

In addition to that, there is a console.log statement printing "hello" somewhere.

I removed it - good catch 👍

@Na1k
Copy link
Author

Na1k commented May 15, 2025

@Lukas742 The issue was sitting in front of the screen...
There was a leftover TableCell import from the @ui5/webcomponents-react package, that's why the error was shown (see Stackblitz example).

I can confirm, that the patch solves the reported issue.

Do you have an estimate when it will be included in an official release of the webcomponents-react-cli package so I can get rid of the snapshot version in the package.json? :)

@Lukas742
Copy link
Contributor

@Na1k Glad to hear!

We roll out feature updates (minor version bumps) to the ui5-webcomponents-react packages shortly after the ui5-webcomponents team publishes their minor releases. The next one (v2.11.0) is scheduled for June 5 (UI5 WC Release Schedule).

If you'd prefer to avoid using a snapshot version in your package.json, I can publish a pre-release version for you - this way, it's SemVer-compliant.

Let me know what works best for you!

@Na1k
Copy link
Author

Na1k commented May 15, 2025

@Lukas742 Thanks a lot for your support on this. A pre-release version would be awesome.

@ui5-webcomponents-react-bot
Copy link
Contributor

ui5-webcomponents-react-bot commented May 16, 2025

🎉 This issue has been resolved in version v2.11.0-rc.0 🎉

The release is available on v2.11.0-rc.0

Your semantic-release bot 📦🚀

Script won't run. I will fix the issue and draft another release

@Lukas742
Copy link
Contributor

Lukas742 commented May 16, 2025

Hi @Na1k

the pre-release is now available and working. The following versions have to be set (only applicable for packages you're using):

    "@ui5/webcomponents-ai-react": "2.11.0-rc.0",
    "@ui5/webcomponents-react-base": "2.11.0-rc.0",
    "@ui5/webcomponents-react-charts": "2.11.0-rc.0",
    "@ui5/webcomponents-react-compat": "2.11.0-rc.0",
    "@ui5/webcomponents-cypress-commands": "2.11.0-rc.0",
    "@ui5/webcomponents-react": "2.11.0-rc.0"
    "@ui5/webcomponents-react-cli": "2.11.0-rc.1",

All other @ui5/webcomponents... dependencies have to use version 2.10.0.

https://stackblitz.com/edit/github-z74gvby1-jpmr9tbp?file=src%2FTestTable.tsx,src%2FTestFilterBar.tsx,src%2FApp.tsx,package.json

@Na1k
Copy link
Author

Na1k commented May 20, 2025

Hi @Lukas742

Thanks a lot! Besides the console.log("hello") statement, The patch works as expected :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging a pull request may close this issue.

3 participants