[2.x] Dropdown toggle keeps a stale copy of the active item's label

Open
#5,561 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@karl-bullock is already working on this.

Since Nov 22, 2026.

  • #5562 by @karl-bullock — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
30/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript
Domain
frontend

Research direction

The bug is in the profile navigation dropdown, which reuses the active item's child vnodes for both its toggle button and its menu, so only one copy updates. Pull request #5562 is already open against this issue, so review and test that change rather than starting a parallel fix. Done means the toggle shows the same badge count as the menu after a Mentions count changes, without a reload, at a 390x844 viewport.

Written by the indexing model from the issue text.

Description

type/bug

Current Behavior

The dropdown used for a profile's navigation on narrow screens takes the active item's label for its own toggle button, and renders the item's children in both the menu and the toggle. A Mithril vnode can only live in one place, so only one of the two copies is updated when the label changes. On a phone, with the Mentions tab, the badge in the open menu updates after a post is edited, but the toggle above it keeps the previous number until the page is reloaded.

Steps to Reproduce

  1. Open a user's profile on a phone-width viewport (Chromium at 390x844 reproduces it).
  2. Go to the Mentions tab with a non-zero badge.
  3. Edit a post so the count changes, for example remove its mention of that user.
  4. The menu badge updates, the toggle above it still shows the old number.
  5. Reload the page: both show the new number.

Expected Behavior

The toggle and the menu show the same label, without a reload.

Environment

  • Flarum version: 2.x (dev)
  • Website URL: local dev forum
  • Webserver: nginx
  • Hosting environment: local
  • PHP version: 8.5
  • Database: PostgreSQL 18
  • Browser: Chromium (headless, 390x844)

Possible Solution

Render the toggle's copy of the label as text rather than reusing the item's vnodes. I have a pull request for that.

Dominant language
PHP
Stars
6.8k
Forks
891
Avg merge
1d 10h
Merged PRs (30d)
209

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from flarum/framework

All issues in flarum/framework

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.