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

オープン
#5,561 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@karl-bullock がすでに取り組んでいます。

2026年11月22日 から。

  • #5562 @karl-bullock による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript
領域
frontend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
PHP
スター
6.8k
フォーク
891
平均マージ
1日 10時間
マージ済み PR(30日)
209

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

flarum/framework のほかの issue

flarum/framework の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。