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

the input field inside the template loses focus after typing a character #53

Open
akbarism opened this issue Nov 16, 2022 · 2 comments
Open

Comments

@akbarism
Copy link

i am using react hooks in this case, everything is running smoothly before any input text in the template,
looks like when typing a character the component re-renders, therefore the input field loses focus, is there any solution to this problem?

it seems it will really take a long time if I look for another package

By the way, I really like your work, it's very easy to understand than other packages!

@ljmzbigsmart
Copy link

I am having the same problem with this package, did you manage to solve it @akbarism? Tried multiple ways (taking the template component out to another function and other "hacky" ways, but same problem.

@Macil
Copy link
Collaborator

Macil commented Mar 14, 2023

This type of issue usually happens from not using the itemKey prop correctly. A component merely re-rendering shouldn't cause it to lose state. It might be that you have the component's key changing in response to the user input, which will cause it to be freshly remounted.

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

No branches or pull requests

3 participants