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: popover-based focus behaviour #2854

Merged
merged 73 commits into from
May 24, 2024
Merged

fix: popover-based focus behaviour #2854

merged 73 commits into from
May 24, 2024

Conversation

wingkwong
Copy link
Member

@wingkwong wingkwong commented Apr 24, 2024

📝 Description

In react aria, popover can be closed by clicking or interacting outside or by escape key (handled by useOverlay). When the popover is closed, focus is back to the trigger, i.e. the input. Since we have different focus behaviours in autocomplete, this PR is to handle them on our side instead of doing them internally on react aria side for better flexibilty.

here's the updated focus behaviour for autocomplete.

  • click selector button -> open listbox -> click selector button -> close listbox -> input stay focused
  • click selector button -> open listbox -> click outside autocomplete-> close listbox -> input stay blurred
  • click selector button -> open listbox -> input stay focused
  • click autocomplete input -> open listbox -> input stay focused
  • open listbox -> select an item -> close listbox -> input stay focused
  • with selected item -> click clear button -> input stay focused and listbox is open
  • whenever it is focus -> click outside -> input stay blurred

the behaviours are consistent even the autocomplete is in the modal.

⛳️ Current behavior (updates)

Please describe the current behavior that you are modifying

🚀 New behavior

pr2854-demo-1.webm
pr2854-demo-2.webm
pr2854-demo-3.webm

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

📝 Additional Information

Summary by CodeRabbit

  • New Features

    • Improved focus management and interaction handling in autocomplete, date-picker, date-range-picker, dropdown, and select components for a better user experience.
  • Bug Fixes

    • Fixed issues with focus behavior across various components to ensure consistent and expected functionality.
  • Refactor

    • Simplified the popover rendering logic in the Select component for cleaner and more maintainable code.

These updates aim to provide a more intuitive and seamless interaction with our components.

Copy link

linear bot commented Apr 24, 2024

Copy link

vercel bot commented Apr 24, 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 May 23, 2024 1:23pm
nextui-storybook-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 23, 2024 1:23pm

Copy link

changeset-bot bot commented Apr 24, 2024

🦋 Changeset detected

Latest commit: c28bf2e

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

This PR includes changesets to release 15 packages
Name Type
@nextui-org/autocomplete Patch
@nextui-org/modal Patch
@nextui-org/popover Patch
@nextui-org/dropdown Patch
@nextui-org/select Patch
@nextui-org/date-picker Patch
@nextui-org/aria-utils Patch
@nextui-org/react Patch
@nextui-org/accordion Patch
@nextui-org/listbox Patch
@nextui-org/menu Patch
@nextui-org/tabs Patch
@nextui-org/tooltip Patch
@nextui-org/slider Patch
@nextui-org/snippet 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

Copy link
Contributor

coderabbitai bot commented Apr 24, 2024

Walkthrough

The recent changes enhance focus management and interaction handling across various components like Autocomplete, DatePicker, DateRangePicker, Dropdown, and Select. These updates address issues related to focus loss, interaction outside components, and the behavior of dropdowns and popovers, ensuring a smoother user experience.

Changes

File/Path Change Summary
.../autocomplete/src/use-autocomplete.ts Added useState for shouldFocus, improved focus and interaction handling for selector button, clear button, and interactions outside the component.
.../date-picker/src/use-date-picker.ts Integrated ariaShouldCloseOnInteractOutside import and shouldCloseOnInteractOutside property in useDatePicker function.
.../date-picker/src/use-date-range-picker.ts Integrated ariaShouldCloseOnInteractOutside import and shouldCloseOnInteractOutside property in useDateRangePicker function.
.../dropdown/src/use-dropdown.ts Integrated ariaShouldCloseOnInteractOutside import and shouldCloseOnInteractOutside property in useDropdown function.
.../select/src/select.tsx Refactored Select component to streamline popover rendering logic by removing unnecessary props and restructuring JSX elements.
.../select/src/use-select.ts Integrated ariaShouldCloseOnInteractOutside import and shouldCloseOnInteractOutside property in PopoverProps object in useSelect function.

Assessment against linked issues

Objective Addressed Explanation
Ensure Autocomplete input retains focus when interacting with the modal (Issues #2849, #2962)
Fix Autocomplete behavior when clearing values and selecting new ones (Issues #2834, #2872)
Ensure Autocomplete dropdown closes properly inside a modal (Issue #2779)
Improve general focus and interaction handling for components using popovers (Issues #1920, #1287, #3060)

The changes successfully address the primary objectives and requirements outlined in the linked issues, leading to enhanced focus management and interaction handling across the affected components.


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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

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

CodeRabbit Configration 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: 3

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 4d76044 and 3105163.
Files selected for processing (7)
  • packages/components/autocomplete/tests/autocomplete.test.tsx (4 hunks)
  • packages/components/autocomplete/src/use-autocomplete.ts (8 hunks)
  • packages/components/date-picker/src/use-date-picker.ts (2 hunks)
  • packages/components/date-picker/src/use-date-range-picker.ts (2 hunks)
  • packages/components/select/src/select.tsx (1 hunks)
  • packages/components/select/src/use-select.ts (2 hunks)
  • packages/utilities/aria-utils/src/overlays/ariaShouldCloseOnInteractOutside.ts (1 hunks)
Files skipped from review as they are similar to previous changes (6)
  • packages/components/autocomplete/tests/autocomplete.test.tsx
  • packages/components/date-picker/src/use-date-picker.ts
  • packages/components/date-picker/src/use-date-range-picker.ts
  • packages/components/select/src/select.tsx
  • packages/components/select/src/use-select.ts
  • packages/utilities/aria-utils/src/overlays/ariaShouldCloseOnInteractOutside.ts
Additional comments not posted (2)
packages/components/autocomplete/src/use-autocomplete.ts (2)

21-21: Consider verifying the usage of ariaShouldCloseOnInteractOutside across other components.

Verification successful

The function ariaShouldCloseOnInteractOutside is used across multiple components, including Select, Popover, Dropdown, DateRangePicker, DatePicker, and Autocomplete. This confirms its widespread usage and importance in handling interactions outside of various UI elements.

  • packages/components/select/src/use-select.ts
  • packages/components/popover/src/use-aria-popover.ts
  • packages/components/dropdown/src/use-dropdown.ts
  • packages/components/date-picker/src/use-date-range-picker.ts
  • packages/components/date-picker/src/use-date-picker.ts
  • packages/components/autocomplete/src/use-autocomplete.ts
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the usage of `ariaShouldCloseOnInteractOutside` across other components.

# Test: Search for the function usage. Expect: Usage in components like Dropdown, DatePicker, DateRangePicker, Popover, Select.
rg --type typescript $'ariaShouldCloseOnInteractOutside'

Length of output: 90



Script:

#!/bin/bash
# Description: Verify the usage of `ariaShouldCloseOnInteractOutside` across other components.

# Test: Search for the function usage. Expect: Usage in components like Dropdown, DatePicker, DateRangePicker, Popover, Select.
rg --type ts $'ariaShouldCloseOnInteractOutside'

Length of output: 1922


474-475: Ensure ariaShouldCloseOnInteractOutside is correctly handling focus management.

Verification successful

The function ariaShouldCloseOnInteractOutside does handle focus management. Specifically, it sets shouldFocus.current to false when interacting outside the component, ensuring that the component (e.g., autocomplete) loses focus appropriately.

  • ariaShouldCloseOnInteractOutside is defined in packages/utilities/aria-utils/src/overlays/ariaShouldCloseOnInteractOutside.ts.
  • The function correctly manages focus by setting shouldFocus.current to false when the interaction is outside the component.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the correct handling of focus management by `ariaShouldCloseOnInteractOutside`.

# Test: Search for the function implementation and check focus management logic.
ast-grep --lang typescript --pattern $'function ariaShouldCloseOnInteractOutside($_, $_, $_, $_) { $$$ }'

Length of output: 106



Script:

#!/bin/bash
# Search for the definition of the function `ariaShouldCloseOnInteractOutside` in the codebase.
rg 'function ariaShouldCloseOnInteractOutside' --type ts

# Also, search for any import statements that might import `ariaShouldCloseOnInteractOutside`.
rg 'ariaShouldCloseOnInteractOutside' --type ts

Length of output: 1981



Script:

#!/bin/bash
# Extract the implementation of `ariaShouldCloseOnInteractOutside` from the specified file.
rg 'export const ariaShouldCloseOnInteractOutside' -A 20 packages/utilities/aria-utils/src/overlays/ariaShouldCloseOnInteractOutside.ts

Length of output: 1014

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 3105163 and 01d2476.
Files selected for processing (1)
  • .changeset/good-crabs-clap.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .changeset/good-crabs-clap.md

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 01d2476 and 624488d.
Files selected for processing (5)
  • packages/components/autocomplete/src/use-autocomplete.ts (8 hunks)
  • packages/components/date-picker/src/use-date-picker.ts (2 hunks)
  • packages/components/date-picker/src/use-date-range-picker.ts (2 hunks)
  • packages/components/dropdown/src/use-dropdown.ts (2 hunks)
  • packages/components/select/src/use-select.ts (3 hunks)
Files skipped from review as they are similar to previous changes (5)
  • packages/components/autocomplete/src/use-autocomplete.ts
  • packages/components/date-picker/src/use-date-picker.ts
  • packages/components/date-picker/src/use-date-range-picker.ts
  • packages/components/dropdown/src/use-dropdown.ts
  • packages/components/select/src/use-select.ts

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 624488d and c28bf2e.
Files selected for processing (1)
  • packages/components/autocomplete/src/use-autocomplete.ts (7 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/components/autocomplete/src/use-autocomplete.ts

@jrgarciadev jrgarciadev merged commit 3b14c21 into canary May 24, 2024
8 checks passed
@jrgarciadev jrgarciadev deleted the fix/eng-668 branch May 24, 2024 19:19
@ewertonce
Copy link

thanks guys! gonna test the new version!

jrgarciadev added a commit that referenced this pull request May 27, 2024
* chore(root): reat-aria packages updated (#2889)

* chore(storybook): common colors enabled (#2902)

* fix(range-calendar): hide only dates outside the month (#2906)

* 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 <shrinidhi.upadhyaya@stud.uni-bamberg.de>
Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>

* fix(date-picker): keep date picker style consistent for different variants (#2908)

* fix: add missing TableRowProps export (#2866)

* fix: add missing TableRowProps export

* feat(changeset): add changeset for PR2866

* chore(changeset): revise changeset message

---------

Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>

* fix(input): correct label margin for RTL required inputs (#2781)

* fix(input): correct label margin for RTL required inputs

* fix(theme): add changeset fr theme

* docs(core): add storybook and canary release info (#2914)

* Cn utility refactor (#2915)

* refactor(core): cn utility adjusted and moved to the theme package

* chore(root): changeset

* fix(storybook): stories that used cn

* docs(date-picker): change to jsx instead (#2919)

* fix(switch): support uncontrolled switch in react-hook-form (#2924)

* 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

* refactor(root): react aria packages fixed (#2944)

* feat(docs): docs changes (#2868)

* 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 <116155762+Nozomi-Hijikata@users.noreply.github.com>
Co-authored-by: HaRuki <soccer_haruki15@me.com>
Co-authored-by: Kaben <carnoxen@gmail.com>

* fix(slider): missing marks when hideThumb is true & revise slider styles (#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(test): react hook form tests & stories (#2931)

* 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 (#2265)

* fix: update accordion item heading tag to be customizable

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

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* 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 <shawn.dong@flybuys.com.au>
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>

* fix(theme): add pointer-events-none to skeleton base (#2972)

* feat(tabs): add `destroyInactiveTabPanel` prop for Tabs component (#2973)

* 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 (#2929)

* 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): remove origin-bottom from button (#2990)

* fix(skeleton): overflow issue in skeleton (#2986)

* fix(theme): set overflow visible after skeleton loaded

* feat(changeset): add changeset

* fix(table): v2 input/textarea don't allow spaces inside a table (#3020)

* fix(table): set onKeyDownCapture to undefined

* feat(changeset): add changeset

* fix(slider): calculate the correct value on mark click (#3017)

* fix(slider): calculate the correct value on mark click

* refactor(slider): remove the tests inside describe block

* feat(slider): add tests for thumb move on mark click

* refactor(slider): use val instead of pos

* fix(theme): revise input isInvalid styles (#3010)

* fix(theme): revise isInvalid input styles

* feat(changeset): add changeset

* feat(date-picker): add missing ref to input wrapper (#3011)

* fix(date-picker): add missing ref to input wrapper

* feat(changeset): add changeset

* fix(core): incorrect tailwind classnames (#3018)

* fix(dropdown): focus behaviour on press / enter keydown (#2970)

* fix(dropdown): set focus on the first item

* feat(dropdown): add keyboard interactions tests

* feat(changeset): add changeset

* fix(dropdown): use fireEvent.keyDown instead

* chore(deps): add @nextui-org/test-utils to dropdown

* refactor(dropdown): pass onKeyDown to menu trigger and don't hardcode autoFocus

* chore(dropdown): remove autoFocus

* fix(menu): pass userMenuProps to useTreeState and useAriaMenu and remove from getListProps

* chore(changeset): add menu package

* fix(component): update type definition to prevent primitive values as items (#2953)

* fix: update type definition to prevent primitive values as items

* fix: typecheck

* fix(select): onSelectionChange can handle number (#2937)

* fix: onSelectionChange type for dynamic items in Select component

* docs: remove unnecessary properties

* docs: update highlightedLines

* chore: add changeset

* fix(calendar): scrolling is hidden when changing the month (#2949)

* fix(calendar): scrolling is hidden when changing the month

* chore(changeset): correct package name

---------

Co-authored-by: Poli Sour <polisour.work@gmail.com>
Co-authored-by: WK Wong <wingkwong.code@gmail.com>

* fix: make VisuallyHidden's element type as span when it's inside phrasing element (#3013)

* fix(checkbox): make VisuallyHidden's element type as span

* feat(changeset): add changeset

* fix(radio): make the VisuallyHidden element type as span

* fix(switch): make the VisuallyHidden element type as span

* fix(select): make the VisuallyHidden element type as span

* feat(changeset): replace changeset

* chore: fix formatting

* docs: sync nextui-cli  api (#3035)

* docs: sync nextui-cli  api

* docs: update

* chore: update routes.json with new path and set updated flag

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* feat: switch default validationBehavior to aria and allow switching via props (#2987)

* chore: add support validationBehavior aria

* chore: add validationBehavior to Provider

* chore: add autocomplete validation test

* chore: add checkbox validation test

* fix(input): require condition

* docs: add description of validationBehavior props

* chore: add support validationBehavior props for date components

* docs(dates): add description of validationBehavior props

* chore: add changeset

* chore: format

* chore: fix test

* fix: select validationBehavior is not support yet

* fix: select validationBehavior not supported yet

* chore(docs): validation behavior prop added to nextui-provider

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* fix: popover-based focus behaviour (#2854)

* fix(autocomplete): autocomplete focus behaviour

* feat(autocomplete): add test case for catching blur cases

* refactor(autocomplete): use isOpen instead

* feat(autocomplete): add "should focus when clicking autocomplete" test case

* feat(autocomplete): add should set the input after selection

* fix(autocomplete): remove shouldUseVirtualFocus

* fix(autocomplete): uncomment blur logic

* refactor(autocomplete): remove state as it is in getPopoverProps

* refactor(autocomplete): remove unnecessary blur

* refactor(select): remove unncessary props

* fix(popover): use domRef instead

* fix(popover): revise isNonModal and isDismissable

* fix(popover): use dialogRef back

* fix(popover): rollback

* fix(autocomplete): onFocus logic

* feat(popover): set disableFocusManagement to overlay

* feat(modal): set disableFocusManagement to overlay

* fix(autocomplete): set disableFocusManagement for autocomplete

* feat(popover): include disableFocusManagement prop

* refactor(autocomplete): revise type in selectorButton

* fix(autocomplete): revise focus logic

* feat(autocomplete): add internal focus state and add shouldCloseOnInteractOutside

* feat(autocomplete): handle selectedItem change

* feat(autocomplete): add clear button test

* feat(changeset): add changeset

* refactor(components): use the original order

* refactor(autocomplete): add more comments

* fix(autocomplete): revise focus behaviours

* refactor(autocomplete): rename to listbox

* chore(popover): remove disableFocusManagement from popover

* chore(autocomplete): remove disableFocusManagement from autocomplete

* chore(changeset): add issue number

* fix(popover): don't set default value to transformOrigin

* fix(autocomplete): revise shouldCloseOnInteractOutside logic

* feat(autocomplete): should close listbox by clicking another autocomplete

* fix(popover): add disableFocusManagement to overlay

* refactor(autocomplete): revise comments and refactor shouldCloseOnInteractOutside

* feat(changeset): add issue number

* fix(autocomplete): merge with selectorButtonProps.onClick

* refactor(autocomplete): remove extra line

* refactor(autocomplete): revise comment

* feat(select): add shouldCloseOnInteractOutside

* feat(dropdown): add shouldCloseOnInteractOutside

* feat(date-picker): add shouldCloseOnInteractOutside

* feat(changeset): add dropdown and date-picker

* fix(popover): revise shouldCloseOnInteractOutside

* feat(date-picker): integrate with ariaShouldCloseOnInteractOutside

* feat(select): integrate with ariaShouldCloseOnInteractOutside

* feat(dropdown): integrate with ariaShouldCloseOnInteractOutside

* feat(popover): integrate with ariaShouldCloseOnInteractOutside

* feat(aria-utils): ariaShouldCloseOnInteractOutside

* chore(deps): update pnpm-lock.yaml

* feat(autocomplete): integrate with ariaShouldCloseOnInteractOutside

* feat(aria-utils): handle setShouldFocus logic

* feat(changeset): add @nextui-org/aria-utils

* chore(autocomplete): put the test into correct group

* feat(select): should close listbox by clicking another select

* feat(dropdown): should close listbox by clicking another dropdown

* feat(popover): should close listbox by clicking another popover

* feat(date-picker): should close listbox by clicking another datepicker

* chore(changeset): add issue numbers and revise changeset message

* refactor(autocomplete): change to useRef instead

* refactor(autocomplete): change to useRef instead

* refactor(aria-utils): revise comments and format code

* chore(changeset): add issue number

* chore: take popoverProps.shouldCloseOnInteractOutside first

* refactor(autocomplete): remove unnecessary logic

* refactor(autocomplete): focus management logic

* fix(components): Fix 'Tap to click' behavior on macOS with Edge/Chrome for Accordion and Tab (#2725)

* fix(components): fix 'Tap to click' behavior on macOS

* Add change file for accordion, menu, and tabs

* Remove 'fix(components)' from the .changeset file

* fix(components): undo dropdown change now that it's no longer applicable

* fix(components): update changeset file now that we are no longer modifying the dropdown component

* fix(date-picker): corrected inert value for true condition (#3054)

* fix(date-picker): corrected inert value for true condition #3044

* refactor(calendar): add todo comment

* feat(changeset): add changeset

---------

Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>
Co-authored-by: WK Wong <wingkwong.code@gmail.com>

* fix(hooks): resolve type error in onKeyDown event handler (#3064)

* fix(hooks): resolve type error in onKeyDown event handler

* chore(changeset): revise changeset

---------

Co-authored-by: WK Wong <wingkwong.code@gmail.com>

* Update dependency array on setPage useCallback hook (#3029)

Changes:
Add the onChangeActivePage function to the dependency array of the setPage useCallback hook to ensure it always reflects the latest state.

Impact:
This fix ensures that the pagination component accurately reflects the current state when triggering onChangeActivePage.

* fix: error peerDep in pkg (#3014)

* fix: error peerDep in pkg

* docs: changeset

* Fix DatePicker Time Input (#2845)

* fix(date-picker): set `isCalendarHeaderExpanded` to `false` when DatePicker is closed

* fix(date-picker): calendar header controlled state on DatePicker

* chore(date-picker): update test

* chore(date-picker): remove unnecessary `async` in test

* Update packages/components/date-picker/__tests__/date-picker.test.tsx

---------

Co-authored-by: WK Wong <wingkwong.code@gmail.com>
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* fix(date-picker): test

* fix(hooks): optimize useScrollPosition with useCallback and useRef (#3049)

* fix(hooks): optimize useScrollPosition with useCallback and useRef

* Update .changeset/lucky-cobras-jog.md

* Update packages/hooks/use-scroll-position/src/index.ts

* Update packages/hooks/use-scroll-position/src/index.ts

---------

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

* fix(select): placeholder text display for controlled component (#3081)

* fix: return placeholder when selectedItems is empty

* chore: add test and changeset

* chore(docs): v2.4.0 (#3084)

* chore(docs): v2.4.0

* chore(docs): v2.4.0 blog

* chore(docs): revise typos based on coderabbitai

* chore(docs): adjust navbar

---------

Co-authored-by: WK Wong <wingkwong.code@gmail.com>

* chore(changese): update @nextui-org/react dependency to minor version

* docs: update cli docs (#3096)

* ci(changesets): version packages (#2903)

Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>

---------

Co-authored-by: Shrinidhi Upadhyaya <shrinidhiupadhyaya1195@gmail.com>
Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>
Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com>
Co-authored-by: Paul Tiedtke <PaulTiedtke@web.de>
Co-authored-by: Mohammad Reza Badri <85818966+mrbadri@users.noreply.github.com>
Co-authored-by: Nozomi-Hijikata <116155762+Nozomi-Hijikata@users.noreply.github.com>
Co-authored-by: HaRuki <soccer_haruki15@me.com>
Co-authored-by: Kaben <carnoxen@gmail.com>
Co-authored-by: Shawn Dong <dsknight@live.com.au>
Co-authored-by: Shawn Dong <shawn.dong@flybuys.com.au>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Ryo Matsukawa <76232929+ryo-manba@users.noreply.github.com>
Co-authored-by: Poli Sour <57824881+novsource@users.noreply.github.com>
Co-authored-by: Poli Sour <polisour.work@gmail.com>
Co-authored-by: Artem Pitikin <git@kosmotema.dev>
Co-authored-by: winches <329487092@qq.com>
Co-authored-by: Eric Abreu <ericfabreu@gmail.com>
Co-authored-by: Minsu <52266597+Gaic4o@users.noreply.github.com>
Co-authored-by: Jesus Perdomo Lampignano <38929969+jesuzon@users.noreply.github.com>
Co-authored-by: chirokas <157580465+chirokas@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment