Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: AppNaviDropdownMenuButton の current 装飾ロジックを見直し #4971

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

uknmr
Copy link
Collaborator

@uknmr uknmr commented Oct 2, 2024

関連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" を探すのをやめる
  • chlidren を引き金 button 内に複製し hidden 属性を付与
  • has() に(tailwlind では has-[[aria-current="page"]] に)まかせてスタイリング

確認方法

@uknmr uknmr requested a review from a team as a code owner October 2, 2024 06:23
@uknmr uknmr requested review from AtsushiM and atzzCokeK and removed request for a team October 2, 2024 06:23
Copy link

pkg-pr-new bot commented Oct 2, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/kufu/smarthr-ui@4971

commit: b349882

@uknmr uknmr marked this pull request as draft October 3, 2024 01:35
@uknmr uknmr force-pushed the fix-AppNaviDropdownMenuButton-current branch from 38fd992 to b349882 Compare October 14, 2024 23:05
@uknmr uknmr marked this pull request as ready for review October 14, 2024 23:06
@uknmr uknmr requested a review from AtsushiM October 15, 2024 00:53
Copy link
Member

@AtsushiM AtsushiM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@uknmr uknmr merged commit 9081990 into master Oct 15, 2024
24 checks passed
@uknmr uknmr deleted the fix-AppNaviDropdownMenuButton-current branch October 15, 2024 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants