Bug in Sidebar Component: Multiple NavItems Considered Active

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

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

まだ誰も着手していません。

評価

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

調査の方向性

Start by locating the Sidebar component’s NavItem active-state matching logic and any tests for nested routes; the issue does not name files or tests. Reproduce with /foo and /foo/bar and check how the component decides which item matches the current URL. Done means only /foo/bar is active on that route.

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

説明

NOTE: We do not look at .zip attachments for issue investigation.

Describe the bug
We're using the Sidebar component with a DataProvider (just building a static list of elements). We have two nav items, with URLs like so:

  • /foo
  • /foo/bar

The Sidebar should add the active CSS class to indicate the current page, which it does. Here I am when I'm at /foo:

Image

However, if I'm on /foo/bar, both of these nav items are flagged as active, and thus both are shown as the current page, incorrectly:

Image

To Reproduce

Add two Nav Items to a Sidebar component instance, one with a URL such as /foo, another which has a URL such as /foo/bar. Visit the /foo/bar route.

Expected behavior

Only The /foo/bar nav item should be considered Active

Versions (please complete the following information):

  • .NET Version: .NET 9
  • BlazorBootstrap: 3.4.0

Desktop (please complete the following information):

  • OS: Windows 11, but reproduces in other environments (client/browser-agnostic)
  • Browser: Confirmed in Firefox and Edge
主要言語
HTML
スター
1.2k
フォーク
111
平均マージ
4分
マージ済み PR(30日)
55

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

vikramlearning/blazorbootstrap のほかの issue

vikramlearning/blazorbootstrap の issue をすべて見る

似ている issue

Web Dev の issue をもっと見る

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

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