You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "lyndagolomb (via GitHub)" <gi...@apache.org> on 2026/10/07 07:41:00 UTC

[I] Horizontal filter bar: native filters disappear after a table cross-filter when Account filter is requiredFirst and Date range has a default (6.1.0) [superset]

lyndagolomb opened a new issue, #45050:
URL: https://github.com/apache/superset/issues/45050

   ### Bug description
   
   In the **horizontal** filter bar, after a table chart emits a cross-filter, all the dashboard's native filters (Account, Date range, Flow) disappear from the bar. There is no "More filters" button either; only the cross-filter chip is left. A full browser refresh brings the native filters back while the cross-filter is still applied. The vertical filter bar does not show the problem (checked on our full dashboard).
   
   **Setup (minimal dashboard, no tabs, no custom CSS)**
   - Dashboard `filter_bar_orientation: HORIZONTAL`.
   - Two charts on the same dataset: a Table chart (aggregate, grouped by one dimension) with cross-filtering enabled (`table_filter: true`), and a Big Number that receives the cross-filter.
   - Three native filters:
     1. **Account**: Value filter, single select, with `requiredFirst: true` and `controlValues.defaultToFirstItem: true` (the "Filter value is required" and "first value by default" behaviour).
     2. **Date range**: Time range filter with a non-empty default, e.g. `DATETRUNC(DATEADD(DATETIME('today'), -1, MONTH), MONTH) : DATETIME('today')`.
     3. **Flow**: plain Value filter.
   
   **Steps**
   1. Open the dashboard. The three native filters are shown in the horizontal bar and Account is applied automatically.
   2. Click a row in the Table chart (cross-filter).
   3. The cross-filter chip appears, but Account / Date range / Flow vanish from the bar, with no overflow ("More filters") control.
   4. Refresh the browser: the native filters reappear and the cross-filter is still applied.
   
   **Expected:** the native filters stay visible (or move into "More filters" if space is tight).
   
   **What we found by bisecting (all with the same cross-filtering table):**
   - Does NOT happen when the Account filter has a required-first setting but the Date range has no default ("No filter").
   - Does NOT happen when the Date range has a default but the Account filter is not `requiredFirst` (default value shown but not auto-applied).
   - DOES happen with `requiredFirst: true` + a default Date range, with or without `enableEmptyFilter`.
   - Tabs, dependent (cascading) filters, a custom cross-filter scope and custom CSS were not needed to reproduce it (we tested minimal dashboards without them).
   - Vertical filter bar: not reproduced on our full dashboard (not re-tested on the minimal one).
   
   ### Screenshots/recordings
   
   Not attached. I can add a screenshot / recording of before and after the click if useful.
   
   ### Superset version
   
   6.1.0 (docker image `apache/superset:6.1.0`)
   
   ### Python version / Node version
   
   Not applicable: this is a frontend (filter bar) problem.
   
   ### Browser
   
   Desktop browser (not tested across browsers).
   
   ### Additional context
   
   - Feature flag: `DASHBOARD_CROSS_FILTERS: True`. Data source: PostgreSQL. No other customizations on the minimal dashboard.
   - Reading the frontend code, `FilterBar/index.tsx` force-applies a filter's default at initialisation only for `requiredFirst` filters, which may be related, since `requiredFirst` is what triggers the problem together with a default Date range.
   - Possibly related: #40721 (cross-filter chips crowding the horizontal bar and pushing filters into overflow) and #33054 (overflow recalculation when filter widths change). I did not find an existing issue for this exact behaviour.
   
   ### Checklist
   
   - [ ] I have searched Superset docs and Slack and didn't find a solution to my problem. (not done)
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
   - [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section. (not checked; frontend-only behaviour, no server error expected)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Horizontal filter bar: native filters disappear after a table cross-filter when Account filter is requiredFirst and Date range has a default (6.1.0) [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #45050: Horizontal filter bar: native filters disappear after a table cross-filter when Account filter is requiredFirst and Date range has a default (6.1.0)
URL: https://github.com/apache/superset/issues/45050


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Horizontal filter bar: native filters disappear after a table cross-filter when Account filter is requiredFirst and Date range has a default (6.1.0) [superset]

Posted by "lyndagolomb (via GitHub)" <gi...@apache.org>.
lyndagolomb commented on issue #45050:
URL: https://github.com/apache/superset/issues/45050#issuecomment-6054077404

   Tested this against the fix in #45051.
   
   **Reproduced on 6.1.0** (`apache/superset:6.1.0`, fresh instance, `birth_names` example dataset): horizontal filter bar, cross-filtering Table + Big Number chart, Account (single-select, first value by default, `requiredFirst`), Date range with a default, and a plain Flow filter. The bug appears with a **narrow browser window**: clicking a table row makes all native filters disappear from the bar, with no "More filters" control. At a wider window it did not reproduce.
   
   **Fixed with the patch:** same 6.1.0 release with only the `forceRender={hasRequiredFirst}` line removed from the `DropdownContainer` in `FilterControls.tsx` (the change in #45051). Same dashboard, same window width: the native filters stay visible after the cross-filter click.
   
   Note: on a dev build of current `master` (without the fix) I could not reproduce at the narrower widths I tried, so the 6.1.0 release is the reliable way to check this.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Horizontal filter bar: native filters disappear after a table cross-filter when Account filter is requiredFirst and Date range has a default (6.1.0) [superset]

Posted by "FrancescoCastaldi (via GitHub)" <gi...@apache.org>.
FrancescoCastaldi commented on issue #45050:
URL: https://github.com/apache/superset/issues/45050#issuecomment-6038146884

   Hi @lyndagolomb @schizophrenicmaniac,
   
   I have opened PR #45051 with the fix and full regression test coverage for this issue.
   
   As described, the root cause was `forceRender={hasRequiredFirst}` being passed to `DropdownContainer`, causing Ant Design's closed `Popover` to mount in hidden DOM and steal `react-reverse-portal` nodes from the horizontal row during layout recalculation. Removing `forceRender` from the container resolves the issue while keeping full test coverage intact.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Horizontal filter bar: native filters disappear after a table cross-filter when Account filter is requiredFirst and Date range has a default (6.1.0) [superset]

Posted by "FrancescoCastaldi (via GitHub)" <gi...@apache.org>.
FrancescoCastaldi commented on issue #45050:
URL: https://github.com/apache/superset/issues/45050#issuecomment-6038165458

   Hi @lyndagolomb,
   
   Thank you for the detailed reproduction steps and bisecting notes.
   
   Your analysis was spot on regarding `requiredFirst`. Here is the exact mechanism that was causing the native filters to vanish:
   
   1. In `FilterControls.tsx`, `hasRequiredFirst` was being passed down as `forceRender={hasRequiredFirst}` to `<DropdownContainer>`, which in turn forwarded it to Ant Design's `<Popover forceRender={forceRender}>`.
   2. Ant Design's `Popover` with `forceRender={true}` mounts its content into the DOM even while closed (`open={false}`).
   3. When you clicked a row in the table chart, a new cross-filter chip was emitted, causing the item list to grow. This triggered a transient re-measurement frame inside `DropdownContainer` where `overflowingCount > 0`.
   4. During that transient frame, the closed popover mounted its content. In Superset, native filters are rendered using `react-reverse-portal` (`<OutPortal>`). A reverse-portal node can only be anchored to a single DOM node at any given time.
   5. The hidden Popover's `<OutPortal>` stole the filter elements from the visible horizontal row. This caused the native filter elements in the main row to collapse to 0px width.
   6. On the next layout frame, `DropdownContainer` measured the container width: because the native filters had collapsed to 0px, all items appeared to fit (`index === -1`). It set `overflowingCount = 0` and unmounted the "More filters" button, destroying the popover and leaving the portal nodes detached without re-attaching them to the main row.
   7. On a full browser refresh, the component mounted in steady-state with both the cross-filter chip and the native filters already present, which is why they reappeared.
   
   I have submitted a comprehensive fix in PR [#45051](https://github.com/apache/superset/pull/45051):
   - Removed `forceRender={hasRequiredFirst}` from `<DropdownContainer>` in `FilterControls.tsx`, ensuring closed overflow popovers never force-mount reverse-portal nodes into hidden DOM.
   - Added regression and integration unit tests covering your exact setup (Account with `requiredFirst`, Date range with default, and emitted cross-filter) in `FilterControls.overflow.test.tsx` and `DropdownContainer.test.tsx`.
   
   If you have a local dev or test container environment, you can test the fix directly from branch `FrancescoCastaldi:fix/issue-45050-horizontal-filterbar-crossfilter`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Horizontal filter bar: native filters disappear after a table cross-filter when Account filter is requiredFirst and Date range has a default (6.1.0) [superset]

Posted by "schizophrenicmaniac (via GitHub)" <gi...@apache.org>.
schizophrenicmaniac commented on issue #45050:
URL: https://github.com/apache/superset/issues/45050#issuecomment-6033888610

   Hi, I'd like to work on this. With requiredFirst, FilterControls force-renders the More filters popover, and while DropdownContainer recalculates overflow after the cross-filter chip appears, the filters' OutPortals seem to get stuck in that hidden popover. I'll fix that and add an RTL test.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org