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

[BUG] - Input props endContent and isClearable cannot be used at the same time #2254

Open
wyx2333333 opened this issue Jan 16, 2024 · 4 comments
Labels
🐛 Type: Bug Something isn't working

Comments

@wyx2333333
Copy link

NextUI Version

2.2.9

Describe the bug

Input cannot use endContent and isClearable together

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

<Input
placeholder="Search Tick"
variant="bordered"
endContent={}
isClearable
/>

Expected behavior

1: show endContent
2: isClearable work

Screenshots or Videos

No response

Operating System Version

macOS

Browser

Chrome

@wyx2333333 wyx2333333 added the 🐛 Type: Bug Something isn't working label Jan 16, 2024
@kght6123
Copy link
Contributor

@wyx2333333 Are you intending to display both the Clear button and endContent when both endContent and isClearable are specified?

I looked at the source code of nextui/input. Currently, if both endContent and isClearable are specified, it seems that the specification replaces the appearance of the Clear button with endContent.
https://github.com/nextui-org/nextui/blob/22f2665b0037a36af9ae1937c5622437c7b67070/packages/components/input/src/input.tsx#L38

I'm not sure if this is the original author's intention, but it appears to be the current behavior.

@wyx2333333
Copy link
Author

@wyx2333333 Are you intending to display both the Clear button and endContent when both endContent and isClearable are specified?

I looked at the source code of nextui/input. Currently, if both endContent and isClearable are specified, it seems that the specification replaces the appearance of the Clear button with endContent.

https://github.com/nextui-org/nextui/blob/22f2665b0037a36af9ae1937c5622437c7b67070/packages/components/input/src/input.tsx#L38

I'm not sure if this is the original author's intention, but it appears to be the current behavior.

yeah. Just like when using the search input like this
<Input isClearable endContent={} />

@kght6123
Copy link
Contributor

@wyx2333333
When isClearable and endContent are required for search input, is the UI like the one below?
The microphone and QR code icons are initially displayed, and when something is entered, they are replaced with the isClearable icon.
https://designsystem.line.me/LDSM/components/search-bar-ex-en

@antonfrolovsky
Copy link

I have also encountered similar behavior. In my case, it is necessary to show both endContent and isClearable.

@kght6123 I look forward to your request being accepted 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants