fix: AppNaviDropdownMenuButton の current 装飾ロジックを見直し #4971
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
関連URL
https://kufuinc.slack.com/archives/C06KVP5PL23/p1727780133229749
概要
AppNaviDropdownMenuButton に
aria-current="page"
を1度でも指定すると、再読み込みされるまで current 装飾がつき続けてしまう不具合の修正提案です。既存ロジックは current をつけるだけで、外す処理がありませんでした。children として渡される要素の
aria-current="page"
を検知する方法できないため、本 PR では引き金ボタン内に hidden 付きの要素として複製し、CSS のhas()
でスタイリングしています。変更内容
React.Children.map
内でaria-current="page"
を探すのをやめるhidden
属性を付与has()
に(tailwlind ではhas-[[aria-current="page"]]
に)まかせてスタイリング確認方法