-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
Client-side component events break input focus #1195
Comments
Relevant code is here. What's probably happening is that the element is getting recreated. With that said, despite the fact that One possible cause is that the element React is mounting to is changing for some reason. |
On a separate note, we might want to add a method to custom components (perhaps |
I have confirmed this same exact behavior using a custom FormControl component from react-boostrap. I have also noticed what is likely the same root issue in a less annoying case using a custom Map component from pigeon-maps. In this latter case, the map flickers every time a change is triggered as if the image tiles are being re-rendered every time. This issue is a big deal based on what I hope to accomplish with reactpy and reactpy-django. So much so that I'd love to be part of the solution. I'm going to take a stab at detangling this, but this still all feels very black-boxy to me. Let me know if anyone else has made progress here before I waste too much time. Thanks! |
I don't believe anyone has had time to untangle this issue yet, so feel free to take a stab at it! |
FYI @williamneto This issue has been resolved, which should fix the controlled inputs problems you've seen with reactpy-material. |
Discussed in #1187
Originally posted by williamneto January 13, 2024
So, while developing reactpy-material i faced a problem that might be related to the reactpy architecture for custom components.
To showcase the problem i created this small component, just a normal textfield. The problem is when attaching a on_change event to this custom component, the event on the page doesn't behavior as expected. Each time you type in the field (and trigger the onChange event) the page focus is moved out of the input element.
So, a simple custom TextField like that
And when you try to use it like that
You end up with this weird behavior at the page focus, making type in this field very unpratical
The text was updated successfully, but these errors were encountered: