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

Abierto
#5,561 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@karl-bullock ya está trabajando en esto.

Desde el 22/11/2026.

  • #5562 de @karl-bullock — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
30/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript
Área
frontend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
PHP
Estrellas
6.8k
Forks
891
Merge medio
1 d 10 h
PR fusionados (30 d)
209

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de flarum/framework

Todos los issues de flarum/framework

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.