SAP / fundamental-ngx

Fundamental Library for Angular is SAP Design System Angular component library
https://sap.github.io/fundamental-ngx
Apache License 2.0
267 stars 127 forks source link

[P2][Sourcing][Sep18]`fdp-select` dropdown does not close after selection in table with `virtualScroll` #10338

Closed CSENoni closed 1 year ago

CSENoni commented 1 year ago

Is this a bug, enhancement, or feature request?

bug

Briefly describe your proposal.

We have a platform table with virtualScroll enabled. After we try to scroll pass renderAhead and open fdp-select dropdown to select a value, the dropdown is not closed till we click outside.

https://github.com/SAP/fundamental-ngx/assets/22842279/b31bce03-f2f7-47ab-880a-ba1e3b91568b

Which versions of Angular and Fundamental Library for Angular are affected? (If this is a feature request, use current version.)

0.43.0

If this is a bug, please provide steps for reproducing it.

Please provide relevant source code if applicable.

https://stackblitz.com/edit/angular-8z3jzr?file=src%2Fapp%2Fplatform-table-page-scrolling-example.component.html

Is there anything else we should know?

May have same cause with https://github.com/SAP/fundamental-ngx/issues/10243 or https://github.com/SAP/fundamental-ngx/issues/10247. fdp-combobox is working fine though but please investigate.

fkolar commented 1 year ago

It works until virtual scroll kicks in

droshev commented 1 year ago

We need to downport to ng15 2

N1XUS commented 1 year ago

@CSENoni Hello. The issue here is not with the popover or select component itself, but with the bottleneck created by using ngIf directive. As I explained in #10339 ticket, during the scroll each select component evaluates it's ngIf condition, and thus reinitializes itself because it uses virtual rows. The fix here would be to hide select not with ngIf but with styling attribute. It should be more efficient rather than modifying DOM tree and reinitializing select component on each scroll.

I'm closing this issue for now.

CSENoni commented 1 year ago

still don't understand why this affects the popover in this scenario, even after reinitialization, should it not affect functionality? However, the provided solution works as explained from https://github.com/SAP/fundamental-ngx/issues/10339. Thanks!