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

Aperta
#5,561 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@karl-bullock ci sta già lavorando.

Dal 22/11/2026.

  • #5562 di @karl-bullock — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
frontend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
PHP
Stelle
6.8k
Fork
891
Merge medio
1g 10h
PR unite (30g)
209

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di flarum/framework

Tutte le issue di flarum/framework

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.