Default filters values cause filter fields to disappear in dashboards
Bug description
Description I have developed an application that embeds dashboards created with Superset using the SDK. The dashboards include a horizontal filter bar. Normally, if there are more filters than the screen resolution can display, the excess filters are collapsed into a "more filters" button. This setup functions correctly under normal circumstances; for example, with 5 filters on a screen that only fits 3, the first 2 filters are displayed explicitly, and the remaining 3 are grouped under the "more filters" button. I've noticed you can reproduce the issue even in the main application (i.e rezing window to force filters grouping: correct behavior if no default value is provided, "more filters" button not showing with some default value applied the first ones.
Issue The issue comes up when default values are set for the filters. Upon embedding, the filters and the "more filters" button render correctly initially. However, as soon as a default value is applied to one of the filters that are displayed explicitly (i.e., those filters not inside the "more filters" button), the "more filters" button disappear, leaving only the filters that fit according to the screen resolution.
Expected Behavior The filter bar should correctly display the first few filters and group any excess under the "more filters" button, regardless of whether default values are set.
Actual Behavior When a default value is applied to one of the explicitly displayed filters, after about a second in which the "more filters" button is rendered correctly, the latter disappears, leaving only the filters that fit in the screen according to the current resolution.
How to reproduce the bug
- Create a Superset dashboard with more than 5 filters.
- Embed this dashboard into an application using the Superset SDK.
- Set a default value for the first filter field.
- Load the application and observe the behavior of the filter bar using a low width resolution so as to force clustering of at least 2 out of 5 filters
Screenshots/recordings
Superset version
master / latest-dev
Python version
3.9
Node version
18 or greater
Browser
Chrome
Additional context
No response
Checklist
- [X] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [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.
Hmmm, interesting. Have you verified that this doesn't happen in a non-embedded dashboard? It seems like it would happen in both settings.
Hi rusackas, I can confirm that it also happens in a standard non-embeddable dashboard. I was easily able to reproduce the described behavior by resizing the window in chrome. At first I thought it was a problem related to the SDK but by doing some further testing I was able to verify that it also happens on the base application
Edited title accordingly. Maybe @kgabryje or @michael-s-molina might have an idea of what's up here.
I can confirm that it also happens in a standard non-embeddable dashboard
I noticed the same - this seems to be a regression occurring after 4.0 release. I updated my superset instance to 4.0.1 and still can experience this issue as well.
Same thing here on 4.0 and also using horizontal filters
Same thing happens to us as well in version 4.0.2.. please fix this asap!!