Skip to content

fix: navigation component#1082

Open
tomasvn wants to merge 3 commits intoFormidableLabs:mainfrom
tomasvn:fix-1081-nav-buttons
Open

fix: navigation component#1082
tomasvn wants to merge 3 commits intoFormidableLabs:mainfrom
tomasvn:fix-1081-nav-buttons

Conversation

@tomasvn
Copy link
Copy Markdown

@tomasvn tomasvn commented Oct 30, 2024

Description

Add new story with arrows enabled, update styles, changed contributing guide, updated navigation to use button elements

Fixes #1081 (issue)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist

  • My code follows the style guidelines of this project (I have run pnpm run lint)

  • I have added tests that prove my fix is effective or that my feature works

  • New and existing unit tests pass locally with my changes (I have run pnpm run test:ci-with-server/pnpm run test)

  • I have performed a self-review of my own code

  • I have commented my code, particularly in hard-to-understand areas

  • I have made corresponding changes to the documentation

  • I have recorded any user-facing fixes or changes with pnpm changeset.

  • My changes generate no new warnings

  • Any dependent changes have been merged and published in downstream modules

  • I have tried to run test via pnpm run check, but test would throw warnings with

console.error
      Warning: `ReactDOMTestUtils.act` is deprecated in favor of `React.act`. Import `act` from `react` instead of `react-dom/test-utils`. See https://react.dev/warnings/react-dom-test-utils for more info.

Add new story, update styles, changed contributing guide
@vercel
Copy link
Copy Markdown

vercel bot commented Oct 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nuka-carousel-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 30, 2024 7:51pm

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Oct 30, 2024

🦋 Changeset detected

Latest commit: 653a62d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
nuka-carousel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

windows narrator would read only numbers without extra context
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the carousel navigation UI to use semantic <button> elements and improves related documentation/stories, aligning with issue #1081’s accessibility goals.

Changes:

  • Replace nav arrow containers with <button> elements and add aria-labels.
  • Update carousel nav button styling and add a Storybook story with arrows enabled.
  • Refresh docs (README install commands, contributing guide) and add a changeset entry.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
README.md Adds install instructions for Yarn/NPM/PNPM.
packages/nuka/src/Carousel/PageIndicators.tsx Improves screen-reader label text for dot/page indicators.
packages/nuka/src/Carousel/NavButtons.tsx Switches arrow controls from div to button with aria-labels.
packages/nuka/src/Carousel/Carousel.stories.tsx Adds a Storybook story enabling arrows.
packages/nuka/src/Carousel/Carousel.css Updates nav button styles and visibility behavior.
CONTRIBUTING.md Updates demo run instructions to the website script.
.changeset/hip-jobs-change.md Adds a patch changeset for the nav element update.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +44 to 47
display: flex;
align-items: center;
justify-content: center;
}
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

.nuka-nav-button declares both display: none and later display: flex, so the display: none is overridden and nav buttons will render even when they are not “enabled”. At the same time, the .nuka-nav-button-enabled rule 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-enabled rule (using display: flex) and remove the conflicting display in the base rule so enabled/disabled + hover behavior works as intended.

Suggested change
display: flex;
align-items: center;
justify-content: center;
}
align-items: center;
justify-content: center;
}
.nuka-nav-button-enabled {
display: flex;
}

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +32
<button
type="button"
className={prevNavClassName}
onClick={goBack}
aria-label="Go to previous slide"
>
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

enablePrevNavButton/enableNextNavButton are computed but not reflected in the buttons’ interactive state. These buttons remain clickable/focusable even when navigation should be disabled at the ends (wrapMode="nowrap"). Consider wiring these booleans to disabled (and matching styles) and/or conditionally omitting the onClick so button semantics match the enabled state.

Copilot uses AI. Check for mistakes.
Comment on lines +20 to 27
Run docosaurus site on `localhost:3000`

```sh
$ pnpm run start:nextjs
$ pnpm run start:website
```

To make changes to the Nuka Carousel library and have those changes reflect in the NextJS demo app also run
To make changes to the Nuka Carousel library and have those changes reflect in the Docosaurus demo app also run

Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

“docosaurus” / “Docosaurus” appears to be a misspelling of “Docusaurus”. Updating this improves clarity and avoids propagating the typo in contributor docs.

Copilot uses AI. Check for mistakes.
'nuka-carousel': patch
---

Replace div for button elements #1081
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

The changeset summary is a bit ungrammatical (“Replace div for button elements”). Consider updating it to something like “Replace div elements with button elements (#1081)” so the release note reads cleanly.

Suggested change
Replace div for button elements #1081
Replace div elements with button elements (#1081)

Copilot uses AI. Check for mistakes.
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.

Replace div elements for native button elements

2 participants