Skip to content

[2.x] fix: statistics date range dropdown clipped by the entity columns - #4950

Merged
imorland merged 3 commits into
2.xfrom
im/statistics-dropdown-clipped
Aug 18, 2026
Merged

[2.x] fix: statistics date range dropdown clipped by the entity columns#4950
imorland merged 3 commits into
2.xfrom
im/statistics-dropdown-clipped

Conversation

@imorland

Copy link
Copy Markdown
Member

Fixes #4949

Changes proposed in this pull request:

The Statistics period dropdown opens into a clipped box, so the menu is invisible behind the graph.

It isn't a z-index problem. .Dropdown-menu already has z-index: var(--zindex-dropdown) (1030), well above anything the chart sets — the menu is being clipped, not painted under. The clipper is overflow: auto on .StatisticsWidget-entities, added in #3940 to let the entity columns scroll horizontally on narrow screens. The period dropdown lives in the labels column inside that same container, and align-items: flex-end puts the labels flush with the container's bottom edge, so the menu's top: 100% lands entirely outside the clip box. No z-index value can escape that, which is why the reporter found changing it had no effect. overflow-x: auto; overflow-y: visible isn't an out either — per spec, if one axis is not visible, the other computes to auto.

The scroll was only ever meant for the entity columns, so this moves it there: the columns get a .StatisticsWidget-entityList wrapper that owns overflow: auto (plus flex: 1; min-width: 0 so it still shrinks and scrolls), leaving the labels column and its dropdown outside any clipping context. .StatisticsWidget-entities keeps its flex row and the 10px gap before the first column. Applied to both StatisticsWidget and MiniStatisticsWidget, which share the class names.

Second, unrelated to the clipping but visible on the same control: .Button--text sets text-decoration: underline on hover, which makes a dropdown toggle read as a link. That variant exists for link-like buttons (the login/signup modal actions), but it's also what core's own admin dropdowns use — SettingDropdown and PermissionDropdown both hardcode buttonClassName = 'Button Button--text', so all three underline. Suppressed for .Dropdown-toggle only; the link-like uses keep their underline.

Impacted: extensions/statistics/less/admin.less, extensions/statistics/js/src/admin/components/{StatisticsWidget,MiniStatisticsWidget}.tsx, framework/core/less/common/Button.less.

Reviewers should focus on:

  • min-width: 0 on the wrapper. Without it the flex item won't shrink below its content width and the scroll never engages — that's the line carrying fix: overflowing forum stats #3940, and it's the thing to check on a narrow viewport.
  • The Button.less change reaches beyond statistics. It also affects SettingDropdown and PermissionDropdown in core admin.

Screenshot

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered? — dropping overflow: auto outright reverts fix: overflowing forum stats #3940; Dropdown-menu--top only moves the clipping to the top edge.
  • For core PRs, does this need to be in core, or could it be in an extension? — the Button--text rule is core's and affects two core dropdowns besides this one.
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Frontend changes: tests are green — n/a, LESS and markup only.
  • Frontend changes: tests have been added — n/a, LESS and markup only.
  • Backend changes: tests are green — no backend changes.
  • Backend changes: tests have been added — no backend changes.
  • Where applicable, changes are suitable for all supported database drivers — no database involvement.
  • Core developer confirmed locally this works as intended.
  • The description above is written by me and describes what this pull request actually does.

@imorland
imorland requested a review from a team as a code owner August 18, 2026 10:42
@imorland imorland added this to the 2.0.0-rc.6 milestone Aug 18, 2026
@imorland
imorland merged commit 880559a into 2.x Aug 18, 2026
24 checks passed
@imorland
imorland deleted the im/statistics-dropdown-clipped branch August 18, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[2.x] Statistics: Date range dropdown covered by graph

1 participant