nextui icon indicating copy to clipboard operation
nextui copied to clipboard

feat(tabs): add click handling for tab items in tests and implementation

Open liaoyinglong opened this issue 1 year ago • 3 comments

📝 Description

Add click handling for tab items in tests and implementation

⛳️ Current behavior (updates)

Currently, the tab component lacks specific click handling and testing for individual tab items.

🚀 New behavior

  • Added a new test case to verify that tab clicks are handled correctly
  • Implemented click handling for individual tab items in the Tab component

💣 Is this a breaking change (Yes/No):

No

📝 Additional Information

This change improves the interactivity and testability of the Tabs component by ensuring that clicks on individual tab items are properly handled and can be tested.

References:

Summary by CodeRabbit

  • New Features

    • Enhanced test coverage for the Tabs component, ensuring click events trigger the correct handlers.
  • Bug Fixes

    • Improved handling of click events in the Tab component by allowing variable arguments to be passed to click handlers.

liaoyinglong avatar Oct 18 '24 07:10 liaoyinglong

🦋 Changeset detected

Latest commit: ca59f162072e7452d5467cb72dc303004e5f337a

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

This PR includes changesets to release 2 packages
Name Type
@heroui/tabs Patch
@heroui/react 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

changeset-bot[bot] avatar Oct 18 '24 07:10 changeset-bot[bot]

Walkthrough

The pull request adds a new test case to verify tab click handling in the Tabs component and updates the handleClick function in the Tab component to ensure chained click handlers are executed correctly.

Changes

File Path Change Summary
packages/components/tabs/__tests__/tabs.test.tsx Added a test case to verify that clicking tabs triggers the correct click handlers and updates state.
packages/components/tabs/src/tab.tsx Updated handleClick to execute chained click handlers properly with chain(onClick, tabProps.onClick)();.
.changeset/seven-tips-help.md Released a patch update addressing click handling issues in tab interactions, with no public API changes.

Possibly related PRs

  • #2973: Adds destroyInactiveTabPanel prop, related to tab interaction behavior.
  • #3164: Modifies tabs.test.tsx to include event handling, aligned with new click handling tests.
  • #3246: Updates test cases in tabs.test.tsx, consistent with the new click handling verification.

Suggested labels

📋 Scope : Docs

Suggested reviewers

  • jrgarciadev

📜 Recent review details

Configuration used: .coderabbit.yaml Review profile: CHILL Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fa9c23931aa24cad5ac2dd8a00c82b0236ccbbd3 and ca59f162072e7452d5467cb72dc303004e5f337a.

📒 Files selected for processing (1)
  • .changeset/seven-tips-help.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/seven-tips-help.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Oct 18 '24 07:10 coderabbitai[bot]

@liaoyinglong is attempting to deploy a commit to the NextUI Inc Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Oct 18 '24 07:10 vercel[bot]

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

Name Status Preview Comments Updated (UTC)
heroui ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 26, 2025 0:44am
heroui-sb ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 26, 2025 0:44am

vercel[bot] avatar May 26 '25 12:05 vercel[bot]

Open in StackBlitz

@heroui/accordion

npm i https://pkg.pr.new/@heroui/accordion@3917
@heroui/alert

npm i https://pkg.pr.new/@heroui/alert@3917
@heroui/autocomplete

npm i https://pkg.pr.new/@heroui/autocomplete@3917
@heroui/avatar

npm i https://pkg.pr.new/@heroui/avatar@3917
@heroui/badge

npm i https://pkg.pr.new/@heroui/badge@3917
@heroui/breadcrumbs

npm i https://pkg.pr.new/@heroui/breadcrumbs@3917
@heroui/button

npm i https://pkg.pr.new/@heroui/button@3917
@heroui/calendar

npm i https://pkg.pr.new/@heroui/calendar@3917
@heroui/card

npm i https://pkg.pr.new/@heroui/card@3917
@heroui/checkbox

npm i https://pkg.pr.new/@heroui/checkbox@3917
@heroui/chip

npm i https://pkg.pr.new/@heroui/chip@3917
@heroui/code

npm i https://pkg.pr.new/@heroui/code@3917
@heroui/date-input

npm i https://pkg.pr.new/@heroui/date-input@3917
@heroui/date-picker

npm i https://pkg.pr.new/@heroui/date-picker@3917
@heroui/divider

npm i https://pkg.pr.new/@heroui/divider@3917
@heroui/drawer

npm i https://pkg.pr.new/@heroui/drawer@3917
@heroui/dropdown

npm i https://pkg.pr.new/@heroui/dropdown@3917
@heroui/form

npm i https://pkg.pr.new/@heroui/form@3917
@heroui/image

npm i https://pkg.pr.new/@heroui/image@3917
@heroui/input

npm i https://pkg.pr.new/@heroui/input@3917
@heroui/input-otp

npm i https://pkg.pr.new/@heroui/input-otp@3917
@heroui/kbd

npm i https://pkg.pr.new/@heroui/kbd@3917
@heroui/link

npm i https://pkg.pr.new/@heroui/link@3917
@heroui/listbox

npm i https://pkg.pr.new/@heroui/listbox@3917
@heroui/menu

npm i https://pkg.pr.new/@heroui/menu@3917
@heroui/modal

npm i https://pkg.pr.new/@heroui/modal@3917
@heroui/navbar

npm i https://pkg.pr.new/@heroui/navbar@3917
@heroui/number-input

npm i https://pkg.pr.new/@heroui/number-input@3917
@heroui/pagination

npm i https://pkg.pr.new/@heroui/pagination@3917
@heroui/popover

npm i https://pkg.pr.new/@heroui/popover@3917
@heroui/progress

npm i https://pkg.pr.new/@heroui/progress@3917
@heroui/radio

npm i https://pkg.pr.new/@heroui/radio@3917
@heroui/ripple

npm i https://pkg.pr.new/@heroui/ripple@3917
@heroui/scroll-shadow

npm i https://pkg.pr.new/@heroui/scroll-shadow@3917
@heroui/select

npm i https://pkg.pr.new/@heroui/select@3917
@heroui/skeleton

npm i https://pkg.pr.new/@heroui/skeleton@3917
@heroui/slider

npm i https://pkg.pr.new/@heroui/slider@3917
@heroui/snippet

npm i https://pkg.pr.new/@heroui/snippet@3917
@heroui/spacer

npm i https://pkg.pr.new/@heroui/spacer@3917
@heroui/spinner

npm i https://pkg.pr.new/@heroui/spinner@3917
@heroui/switch

npm i https://pkg.pr.new/@heroui/switch@3917
@heroui/table

npm i https://pkg.pr.new/@heroui/table@3917
@heroui/tabs

npm i https://pkg.pr.new/@heroui/tabs@3917
@heroui/toast

npm i https://pkg.pr.new/@heroui/toast@3917
@heroui/tooltip

npm i https://pkg.pr.new/@heroui/tooltip@3917
@heroui/user

npm i https://pkg.pr.new/@heroui/user@3917
@heroui/react

npm i https://pkg.pr.new/@heroui/react@3917
@heroui/system

npm i https://pkg.pr.new/@heroui/system@3917
@heroui/system-rsc

npm i https://pkg.pr.new/@heroui/system-rsc@3917
@heroui/theme

npm i https://pkg.pr.new/@heroui/theme@3917
@heroui/use-aria-accordion

npm i https://pkg.pr.new/@heroui/use-aria-accordion@3917
@heroui/use-aria-accordion-item

npm i https://pkg.pr.new/@heroui/use-aria-accordion-item@3917
@heroui/use-aria-button

npm i https://pkg.pr.new/@heroui/use-aria-button@3917
@heroui/use-aria-link

npm i https://pkg.pr.new/@heroui/use-aria-link@3917
@heroui/use-aria-modal-overlay

npm i https://pkg.pr.new/@heroui/use-aria-modal-overlay@3917
@heroui/use-aria-multiselect

npm i https://pkg.pr.new/@heroui/use-aria-multiselect@3917
@heroui/use-callback-ref

npm i https://pkg.pr.new/@heroui/use-callback-ref@3917
@heroui/use-clipboard

npm i https://pkg.pr.new/@heroui/use-clipboard@3917
@heroui/use-data-scroll-overflow

npm i https://pkg.pr.new/@heroui/use-data-scroll-overflow@3917
@heroui/use-disclosure

npm i https://pkg.pr.new/@heroui/use-disclosure@3917
@heroui/use-draggable

npm i https://pkg.pr.new/@heroui/use-draggable@3917
@heroui/use-image

npm i https://pkg.pr.new/@heroui/use-image@3917
@heroui/use-infinite-scroll

npm i https://pkg.pr.new/@heroui/use-infinite-scroll@3917
@heroui/use-intersection-observer

npm i https://pkg.pr.new/@heroui/use-intersection-observer@3917
@heroui/use-is-mobile

npm i https://pkg.pr.new/@heroui/use-is-mobile@3917
@heroui/use-is-mounted

npm i https://pkg.pr.new/@heroui/use-is-mounted@3917
@heroui/use-measure

npm i https://pkg.pr.new/@heroui/use-measure@3917
@heroui/use-pagination

npm i https://pkg.pr.new/@heroui/use-pagination@3917
@heroui/use-real-shape

npm i https://pkg.pr.new/@heroui/use-real-shape@3917
@heroui/use-ref-state

npm i https://pkg.pr.new/@heroui/use-ref-state@3917
@heroui/use-resize

npm i https://pkg.pr.new/@heroui/use-resize@3917
@heroui/use-safe-layout-effect

npm i https://pkg.pr.new/@heroui/use-safe-layout-effect@3917
@heroui/use-scroll-position

npm i https://pkg.pr.new/@heroui/use-scroll-position@3917
@heroui/use-ssr

npm i https://pkg.pr.new/@heroui/use-ssr@3917
@heroui/use-theme

npm i https://pkg.pr.new/@heroui/use-theme@3917
@heroui/use-update-effect

npm i https://pkg.pr.new/@heroui/use-update-effect@3917
@heroui/aria-utils

npm i https://pkg.pr.new/@heroui/aria-utils@3917
@heroui/dom-animation

npm i https://pkg.pr.new/@heroui/dom-animation@3917
@heroui/framer-utils

npm i https://pkg.pr.new/@heroui/framer-utils@3917
@heroui/react-utils

npm i https://pkg.pr.new/@heroui/react-utils@3917
@heroui/react-rsc-utils

npm i https://pkg.pr.new/@heroui/react-rsc-utils@3917
@heroui/shared-icons

npm i https://pkg.pr.new/@heroui/shared-icons@3917
@heroui/shared-utils

npm i https://pkg.pr.new/@heroui/shared-utils@3917
@heroui/stories-utils

npm i https://pkg.pr.new/@heroui/stories-utils@3917
@heroui/test-utils

npm i https://pkg.pr.new/@heroui/test-utils@3917

commit: ca59f16

pkg-pr-new[bot] avatar May 26 '25 12:05 pkg-pr-new[bot]