Skip to content

feat(SearchBar): add enter-key search, read-only mode, focus/blur events, and maxLength support#2

Open
syed-ghufran-hassan wants to merge 1 commit intocharlesbarleyman:mainfrom
syed-ghufran-hassan:patch-2
Open

feat(SearchBar): add enter-key search, read-only mode, focus/blur events, and maxLength support#2
syed-ghufran-hassan wants to merge 1 commit intocharlesbarleyman:mainfrom
syed-ghufran-hassan:patch-2

Conversation

@syed-ghufran-hassan
Copy link
Copy Markdown

Added Enter key support: Pressing Enter triggers onSearch immediately for faster user interaction.

Introduced read-only mode via readOnly prop:

Input is non-editable.

Clear button is hidden when in read-only mode.

Added optional maxLength prop to limit input characters.

Added focus and blur callbacks (onFocus and onBlur) for better control over input lifecycle events.

Ensured backwards compatibility:

All existing props (placeholder, debounceMs, showIcon, showClear, etc.) continue to work.

Component styling remains unchanged.

Maintains memoization and ref forwarding for optimized rendering.

…nts, and maxLength support

Added Enter key support: Pressing Enter triggers onSearch immediately for faster user interaction.

Introduced read-only mode via readOnly prop:

Input is non-editable.

Clear button is hidden when in read-only mode.

Added optional maxLength prop to limit input characters.

Added focus and blur callbacks (onFocus and onBlur) for better control over input lifecycle events.

Ensured backwards compatibility:

All existing props (placeholder, debounceMs, showIcon, showClear, etc.) continue to work.

Component styling remains unchanged.

Maintains memoization and ref forwarding for optimized rendering.
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.

1 participant