vaadin / flow-components

Java counterpart of Vaadin Web Components
101 stars 66 forks source link

Spreadsheet table filter popups still displayed in the UI even if setVisible(false) and setHeaderHidden(true) are called #5608

Open WoozyG opened 1 year ago

WoozyG commented 1 year ago

Description

there is no way to hide/remove the Spreadsheet component overlays for table column filter menus.

As the title says, even if setVisible(false) and setHeaderHidden(true) are called in an overridden registerTable() method, the UI still renders the overlays.

There is no way to remove the overlays entirely, and we can't inject a subclass of SpreadsheetFilterTable or replace with SpreadsheetTable without possibly creating side effects, as there is no preventing the caller from doing further work with the instance they passed, even if the implementation ignores it.

Expected outcome

If the overlay has no content, it shouldn't be displayed at all.

Ideally, this would not be needed if #5607 were fixed.

Minimal reproducible example

https://github.com/WoozyG/sheet-tables

Steps to reproduce

Run the given sample project, and note the tables still have overlay buttons even though they have no content.

Environment

Vaadin version(s): 24.2 OS: N/A

Browsers

Issue is not browser related

WoozyG commented 3 months ago

This is still an issue in 24.4.7. The problem stems partly from SpreadsheetFactory.loadSheetTables() which doesn't check if the XLSX table has autoFilter set or not, and always creates a filter table. Thus, if we don't want filters, there is neither a way to turn them off or to define the file to not use them, and have it honored.

We need tables, but filters are implemented very incompletely, and completely mess up the display if the table is dynamically updated. We need a way to turn them off.