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] -Problem with Input component and events for it #4948

Open
spahicadis opened this issue Feb 27, 2025 · 2 comments
Open

[BUG] -Problem with Input component and events for it #4948

spahicadis opened this issue Feb 27, 2025 · 2 comments

Comments

@spahicadis
Copy link

spahicadis commented Feb 27, 2025

HeroUI Version

@heroui/[email protected]

Describe the bug

I ran into a very strange bug, I simply have an input component meant for live search. I started with a simple implementation, the component and the events for it are behaving very strangely. The classic onChange or event from the onEventChange documentation doesn't work as it should for me. Sorry, I'm using HeroUI for the first time, so maybe I don't know something, but in all other UI libraries it worked successfully for me.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

It doesn't work properly for me, it's literally identical as in the documentation, and the matter is trivial. My input is completely blocked, or after each input I have to click on it again (you will see it in the attached video):

const [searchInputValue, setSearchInputValue] = useState("");
   <Input
              startContent={<SearchIcon />}
              placeholder="Tražite po imenu prijave..."
              size="md"
              radius="sm"
              value={searchInputValue}
              onValueChange={setSearchInputValue}
            ></Input>


  <Input
              startContent={<SearchIcon />}
              placeholder="Tražite po imenu prijave..."
              size="md"
              radius="sm"
              onChange={(e) => {
                setSearchInputValue(e.target.value)
              }}
            ></Input>

This works without problems, it prints the value from the input and does not block my input. (So ​​the problem comes when I use setters):

  <Input
              startContent={<SearchIcon />}
              placeholder="Tražite po imenu prijave..."
              size="md"
              radius="sm"
              onChange={(e) => {
                console.log(e.target.value)
              }}
            />

Expected behavior

Easily set the value in the state from the input, without blocking the input or clicking on the input again after entering a single character

Screenshots or Videos

https://www.icloud.com/iclouddrive/0245CSWta0jLIVKt4WBQjQUUQ#Screen_Recording_2025-02-27_at_12.45.58

Operating System Version

macOS

Browser

Chrome

Copy link

linear bot commented Feb 27, 2025

@wingkwong
Copy link
Member

I couldn't reproduce the issue. Please upgrade to 2.7.4 and retry. If the issue still persists, please set up a minimal reproducible environment for us to have a further investigation. Thanks.

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

No branches or pull requests

2 participants