-
Notifications
You must be signed in to change notification settings - Fork 591
fix: navigation component #1082
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
base: main
Are you sure you want to change the base?
Changes from all commits
3518dfe
a391411
653a62d
db8ae25
b52b613
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| 'nuka-carousel': patch | ||
| --- | ||
|
|
||
| Replace div elements with button elements (#1081) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,7 +24,13 @@ export function NavButtons() { | |
|
|
||
| return ( | ||
| <> | ||
| <div className={prevNavClassName} onClick={goBack}> | ||
| <button | ||
| type="button" | ||
| className={prevNavClassName} | ||
| onClick={goBack} | ||
| disabled={!enablePrevNavButton} | ||
| aria-label="Go to previous slide" | ||
| > | ||
|
Comment on lines
+27
to
+33
|
||
| <svg | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| viewBox="0 0 20 20" | ||
|
|
@@ -36,8 +42,14 @@ export function NavButtons() { | |
| clipRule="evenodd" | ||
| /> | ||
| </svg> | ||
| </div> | ||
| <div className={nextNavClassName} onClick={goForward}> | ||
| </button> | ||
| <button | ||
| type="button" | ||
| className={nextNavClassName} | ||
| onClick={goForward} | ||
| disabled={!enableNextNavButton} | ||
| aria-label="Go to next slide" | ||
| > | ||
| <svg | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| viewBox="0 0 20 20" | ||
|
|
@@ -49,7 +61,7 @@ export function NavButtons() { | |
| clipRule="evenodd" | ||
| /> | ||
| </svg> | ||
| </div> | ||
| </button> | ||
| </> | ||
| ); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.nuka-nav-buttondeclares bothdisplay: noneand laterdisplay: flex, so thedisplay: noneis overridden and nav buttons will render even when they are not “enabled”. At the same time, the.nuka-nav-button-enabledrule was removed but the class is still used (and referenced by the auto-hide hover selector), so arrow visibility logic is inconsistent. Reintroduce a.nuka-nav-button-enabledrule (usingdisplay: flex) and remove the conflictingdisplayin the base rule so enabled/disabled + hover behavior works as intended.