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

UI5-Select *ngFor directive for Angular (5.2.11) not working with latest release of UI5 WC

Open Smux opened this issue 7 years ago • 6 comments

Good day,

we are using UI5 Web Components in our Angular project (v5.2.11) and everything worked very well recently. However, we migrated from ui5 web components 1.0.0-rc.2 to 1.0.0-rc.4 and now the ngFor directive does not work anymore for ui5-select on the ui5-option element. It just does not render any ui5-option. This worked fine with the rc.2 and Angular 5.2.11 but it is not working anymore after updating ui5 web components. We have tested the ui5-select and ui5-option with Angular 8 which succeeded.

Can you tell us why this is not supported anymore and how we can fix this? We need the latest UI5 WC Release because of the IE/EDGE Polyfills but we cannot use it if the ui5-select is not working anymore.

This was tested on multiple OS (Mac and Windows). There is no error thrown in the console and no hint anywhere else.

We would be happy to get some support here :)

Smux avatar Nov 15 '19 11:11 Smux

Hi Smux,

Could you please provide an isolated example where the issue is reproduced(perhaps in codesandbox or a repo) with the exact version of all angular dependencies(core, common...) that you are using.

Moreover, please make sure you are adding ui5-option the same way as in your application, because some time ago Angular deprecated ngFor in favor of NgForOf.

Best regards, Filip

fifoosid avatar Nov 15 '19 14:11 fifoosid

Good day and thank you for your fast response :) I tried to set up a codesandbox but ui5 web components do not even work there at all. https://codesandbox.io/s/angular-qmig8?fontsize=14&hidenavigation=1&theme=dark

I set it up exactly like mentioned in the Angular Tutorial for UI5 Web Components and it does not work.. Did I miss something? With the same set up it works locally. @fifoosid

Smux avatar Nov 15 '19 15:11 Smux

Hi @Smux,

I couldn't run it on CodeSandbox as well, but when I downloaded the project and added the following tsconfig.app.json file:

{
    "compileOnSave": false,
    "compilerOptions": {
      "baseUrl": "./",
      "outDir": "./dist/out-tsc",
      "sourceMap": true,
      "declaration": false,
      "module": "es2015",
      "moduleResolution": "node",
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "importHelpers": true,
      "target": "es5",
      "typeRoots": [
        "node_modules/@types"
      ],
      "lib": [
        "es2015",
        "dom"
      ]
    }
}

I was able to start it locally and everything worked as expected:

image

It looks like a bug in CodeSandbox to me because as you can see here UI5 Web Components are working in CodeSandbox.

In the meantime you can add the code about the ui5-select that you have on your side, so that i can debug it locally.

fifoosid avatar Nov 18 '19 07:11 fifoosid

Hello @fifoosid , I updated the project accordingly to create a minimal POC for this issue: https://codesandbox.io/s/angular-qmig8?fontsize=14&hidenavigation=1&theme=dark

It now contains a ui5-select element that should have options based on a components properties that represents an array of data.

Smux avatar Nov 18 '19 11:11 Smux

Hi @Smux

I started the project locally and it doesn't look like there is any issue with the ui5-select: image

I tried with angular version 5.2.11(the one you are using), not 5.2.0 and it worked as expected as well.

Perhaps you have some CSS on parent which is hiding somehow the ui5-option?

fifoosid avatar Nov 18 '19 12:11 fifoosid

Hi @Smux

The problem was fixed with the following PR. The fix will be available in the next UI5 Web Components release.

BR, Filip

fifoosid avatar Nov 22 '19 11:11 fifoosid