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(docs): scroll controlled dropdown #3522

Merged
merged 158 commits into from
Jul 22, 2024
Merged

fix(docs): scroll controlled dropdown #3522

merged 158 commits into from
Jul 22, 2024

Conversation

tianenpang
Copy link
Member

@tianenpang tianenpang commented Jul 20, 2024

Closes #

📝 Description

Fix scroll controlled dropdown menu.

⛳️ Current behavior (updates)

The dropdown state can't be properly controlled while scrolling.

🚀 New behavior

Can now control the dropdown state while scrolling and still supports press actions.

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

No.

📝 Additional Information

Screen.Recording.mov

Summary by CodeRabbit

  • New Features

    • Improved accessibility and usability of the dropdown component by integrating its functionality into a new button.
    • Enhanced interaction model with a clearer toggling mechanism for dropdown visibility.
  • Bug Fixes

    • Streamlined the dropdown opening mechanism, removing complexity for a more intuitive user experience.

jrgarciadev and others added 30 commits April 28, 2024 11:55
* fix(range-calendar): hide only dates outside the month #2890

* fix(range-calendar): corrected spelling mistake in changeset description

* fix(range-calendar): corrected capitalization in changeset description

* chore(changeset): patch @nextui-org/theme

---------

Co-authored-by: shrinidhi.upadhyaya <[email protected]>
Co-authored-by: աɨռɢӄաօռɢ <[email protected]>
* fix: add missing TableRowProps export

* feat(changeset): add changeset for PR2866

* chore(changeset): revise changeset message

---------

Co-authored-by: աɨռɢӄաօռɢ <[email protected]>
* fix(input): correct label margin for RTL required inputs

* fix(theme): add changeset fr theme
* refactor(core): cn utility adjusted and moved to the theme package

* chore(root): changeset

* fix(storybook): stories that used cn
* feat(switch): add @nextui-org/use-safe-layout-effect

* chore(deps): add @nextui-org/use-safe-layout-effect

* fix(switch): react-hook-form uncontrolled switch component

* fix(switch): react-hook-form uncontrolled switch component

* feat(switch): add rect-hook-form in dev dep

* feat(switch): add WithReactHookFormTemplate
* feat(docs): add example how to set locale (#2867)

* docs(guide): add an explanation for the installation guide (#2769)

* docs(guide): add an explanation for the installation guide

* docs(guide): add an explanation for the cli guide

* docs(guide): add support for cli output

* fix: change sort priority - cmdk (#2873)

* docs: remove unsupported props in range calendar and date range picker (#2881)

* chore(calendar): remove showMonthAndYearPickers from range calendar story

* docs(date-range-picker): remove showMonthAndYearPickers info

* docs(range-calendar): remove unsupported props

* docs: refactor typing in form.ts (#2882)

* chore(docs): supplement errorMessage behaviour in input (#2892)

* refactor(docs): revise NextUI Provider structure

* chore(docs): add updated tag

---------

Co-authored-by: Nozomi-Hijikata <[email protected]>
Co-authored-by: HaRuki <[email protected]>
Co-authored-by: Kaben <[email protected]>
…les (#2883)

* chore(slider): include marks in hideThumb

* fix(slider): revise slider styles

* feat(changeset): add changeset

* feat(slider): add tests with marks and hideThumb
* feat(input): add Input with React Hook Form tests

* refactor(input): add missing types

* feat(checkbox): add checkbox with React Hook Form tests

* feat(select): add react-hook-form to dev dep

* feat(select): add react hook form story

* feat(select): react hook form tests

* fix(select): incorrect button reference

* feat(deps): add react-hook-form to dev dep in autocomplete

* feat(autocomplete): react hook form story

* feat(autocomplete): react hook form tests

* fix(autocomplete): rollback wrapper type

* feat(switch): add react hook form tests

* refactor(stories): reorder stories items
* fix: update accordion item heading tag to be customizable

* Update .changeset/heavy-hairs-join.md

Co-authored-by: Junior Garcia <[email protected]>

* Update .changeset/heavy-hairs-join.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* chore(accordion): lint

* chore(changeset): add issue number

* feat(docs): add HeadingComponent prop

---------

Co-authored-by: Shawn Dong <[email protected]>
Co-authored-by: Junior Garcia <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: աɨռɢӄաօռɢ <[email protected]>
)

* feat(tabs): add destroyInactiveTabPanel and set default to false

* feat(tabs): integrate with destroyInactiveTabPanel

* feat(theme): hidden inert tab panel

* feat(changeset): add changeset

* chore(changeset): add issue number

* feat(docs): add `destroyInactiveTabPanel` prop to tabs page

* chore(docs): set destroyInactiveTabPanel to true by default

* chore(tabs): set destroyInactiveTabPanel to true by default

* chore(tabs): revise destroyInactiveTabPanel logic

* feat(tabs): add tests for destroyInactiveTabPanel

* chore(tabs): change the default value of destroyInactiveTabPanel to true
* refactor: add support for disabling the animation globally

* chore(docs): disableAnimation removed from global provider

* feat(docs): nextui provider api updated, storybook preview adjusted

* chore(theme): button is scalable when disabled, tooltip animation improved
* fix(theme): set overflow visible after skeleton loaded

* feat(changeset): add changeset
github-actions bot and others added 15 commits July 17, 2024 14:21
* fix(system-rsc): defaultVariants null case in extendVariants

* chore(changeset): add issue number
…es (#2947)

* fix(status): normalize 'status' value to lowercase in page.tsx

* fix(status): normalize 'status' value to lowercase in use-case.ts

* fix(status): normalize 'status' value to lowercase in custom-render-value.ts

* fix(status): normalize 'status' value to lowercase in top-content.ts

* fix(status): normalize 'status' value to lowercase in multiple-chips.ts

* fix(status): normalize 'status' value to lowercase in custom-items.ts

* fix(status): normalize 'status' value to lowercase in data.ts

* fix(status): normalize 'status' value to lowercase in custom-styles.ts

* fix(status): normalize 'status' value to lowercase in page.tsx

* fix(status): normalize 'status' value to lowercase in custom-styles.ts

* fix(status): normalize 'status' value to lowercase in custom-items.ts

* fix(status): normalize 'status' value to lowercase in page.tsx

* fix(status): normalize 'status' value to lowercase in custom-styles.ts
* fix(modal): double scrollbar in inside scrollbehaviour

* chore(changeset): update changeset message and add issue number

---------

Co-authored-by: WK Wong <[email protected]>
)

* fix(table): sortable header slow color change during theme change

* chore(changeset): add space

---------

Co-authored-by: WK Wong <[email protected]>
* fix(system-rsc): add @react-types/shared to dependencies

* fix: change pnpm lock

* fix: change pnpm lock

* fix: change pnpm lock

---------

Co-authored-by: winches <[email protected]>
running clean lock before clean node modules.
Copy link

vercel bot commented Jul 20, 2024

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

Name Status Preview Comments Updated (UTC)
nextui-docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 22, 2024 4:21pm
nextui-storybook-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 22, 2024 4:21pm

Copy link

changeset-bot bot commented Jul 20, 2024

⚠️ No Changeset found

Latest commit: 17c426a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link
Contributor

coderabbitai bot commented Jul 20, 2024

Walkthrough

The changes to the A11yOtb component streamline the dropdown functionality by removing the DropdownTrigger and integrating its capabilities into a new Button element. This enhancement improves control over the dropdown's state through a triggerRef and updates the opening mechanism to simplify user interaction. Notably, the button's label now adapts based on the mobile state, enhancing accessibility and usability.

Changes

Files Change Summary
apps/docs/components/marketing/a11y-otb.tsx Removed DropdownTrigger, integrated its functionality into a new Button, created triggerRef for better state management, and improved dropdown opening mechanism. Button label updated based on isMobile state.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @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.

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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f052c34 and 0fe112b.

Files selected for processing (1)
  • apps/docs/components/marketing/a11y-otb.tsx (5 hunks)
Additional comments not posted (6)
apps/docs/components/marketing/a11y-otb.tsx (6)

24-24: Import statement approved.

The useRef and useState hooks are correctly imported from React.


81-82: Addition of triggerRef approved.

The triggerRef is correctly created using useRef to manage the button element.


159-167: Addition of Button element approved.

The new Button element correctly uses triggerRef, conditionally labels the button based on isMobile, and toggles the dropdown's open state.


177-179: Passing triggerRef to Dropdown component approved.

The triggerRef is correctly passed to the Dropdown component to manage the dropdown's trigger element.


Line range hint 159-179:
Integration of Button and Dropdown components approved.

The new Button and Dropdown components are logically integrated within the GradientBox, maintaining the component's structure.


Line range hint 81-179:
Overall changes approved.

The changes streamline the dropdown functionality, enhance accessibility, and improve user interaction.

@wingkwong wingkwong self-assigned this Jul 21, 2024
@wingkwong wingkwong assigned jrgarciadev and unassigned wingkwong Jul 21, 2024
@jrgarciadev jrgarciadev changed the base branch from canary to main July 22, 2024 16:17
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.

None yet