Skip to content

feat(stateReducer): add blur source when clicking outside - #1705

Merged
silviuaavram merged 1 commit into
masterfrom
feat/add-blur-reason-in-reducer-object
Nov 9, 2026
Merged

silviuaavram merged 1 commit into
masterfrom
feat/add-blur-reason-in-reducer-object

Conversation

@silviuaavram

@silviuaavram silviuaavram commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Pull Request

What

Add {source: 'outside'} to blurs that were made by touching / clicking outside.

Why

Better distinguish the event source to make decisions.
Closes #1632.

How

Add the metadata and the types.

Changes

Add the source 'outside' property to dispatch in the click outside function.

Checklist

  • Documentation
  • Tests
  • TypeScript Types
  • Ready to be merged

Copilot AI balanced review requested due to automatic review settings November 7, 2026 17:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the change that distinguishes outside dismissal from normal blur.

No open issues 🎉

What changed in this PR

Adds source: 'outside' to outside-click and touch blur actions in useSelect and useCombobox, allowing custom state reducers to distinguish outside dismissal from normal blur behavior.

Changes:

  • Tags outside-triggered blur actions and updates their TypeScript types.
  • Extends tests to check that outside interactions include the source and normal blurs omit it.
  • Documents how to ignore outside blur actions in custom state reducers.
File Description
src/​hooks/​useSelect/​README.md Documents blur source metadata and reducer usage.
src/​hooks/​useSelect/​index.types.ts Adds optional source metadata to action types.
src/​hooks/​useSelect/​index.ts Tags outside-triggered toggle button blur actions.
src/​hooks/​useSelect/​__tests__/​getToggleButtonProps.test.js Checks source metadata for outside and normal blurs.
src/​hooks/​useCombobox/​README.md Documents blur source metadata and reducer usage.
src/​hooks/​useCombobox/​index.types.ts Adds optional source metadata to action types.
src/​hooks/​useCombobox/​index.ts Tags outside-triggered input blur actions.
src/​hooks/​useCombobox/​__tests__/​getInputProps.test.js Checks source metadata for outside and normal blurs.

Review effort: Balanced

@silviuaavram
silviuaavram merged commit 5c96831 into master Nov 9, 2026
5 checks passed
@silviuaavram
silviuaavram deleted the feat/add-blur-reason-in-reducer-object branch November 9, 2026 12:37
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 9.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: allow disabling the "clicking outside" mouse handler

2 participants