You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Solara application where there is a separate thread (solara.use_thread or solara.lab.use_task) that periodically performs some work and updates a text component, at some interval. In addition, there are some other components that use solara.InputInt/solara.InputFloat/solara.InputText that the user can interact with.
However, if the user is in the middle of inputting a value (the cursor is located in the Input component) and the thread runs its work and updates its text component, the current value of the Input component is resetted. This makes it very hard to input values if the thread runs at, .e.g. once every second, as it will just reset the value the user tries to input.
I know that there is a parameter called "continuous_update=True" that will set the value of the Input component for every single character inputted, but the problem is that this, in turn, would trigger a huge amount of updates in other places of my application, which I would want to avoid (e.g. a text field might contain 50 characters, which would mean 50 updates).
If you try to input an integer into the first IntInput, your progress will be lost every second, so you need to be very quick when inputting the value. There are also some debug prints to show when a component is updated, and it actually seems like the input components are not updated when the thread is running, but even still the progress seems to be lost? I don't understand that.
This problem (so far) only occurs with solara iunput components, and other types of components behave as expected.
Python: 3.11.7
Solara: 1.39.0
The text was updated successfully, but these errors were encountered:
I have a Solara application where there is a separate thread (solara.use_thread or solara.lab.use_task) that periodically performs some work and updates a text component, at some interval. In addition, there are some other components that use solara.InputInt/solara.InputFloat/solara.InputText that the user can interact with.
However, if the user is in the middle of inputting a value (the cursor is located in the Input component) and the thread runs its work and updates its text component, the current value of the Input component is resetted. This makes it very hard to input values if the thread runs at, .e.g. once every second, as it will just reset the value the user tries to input.
I know that there is a parameter called "continuous_update=True" that will set the value of the Input component for every single character inputted, but the problem is that this, in turn, would trigger a huge amount of updates in other places of my application, which I would want to avoid (e.g. a text field might contain 50 characters, which would mean 50 updates).
I checked with @maartenbreddels in the Solara discord server, and he suggested that this is a bug, and that i can open an issue here. He even created a small working example of the problem in PyCafe here (thanks!): https://py.cafe/maartenbreddels/solara-rerender-input-bug
If you try to input an integer into the first IntInput, your progress will be lost every second, so you need to be very quick when inputting the value. There are also some debug prints to show when a component is updated, and it actually seems like the input components are not updated when the thread is running, but even still the progress seems to be lost? I don't understand that.
This problem (so far) only occurs with solara iunput components, and other types of components behave as expected.
Python: 3.11.7
Solara: 1.39.0
The text was updated successfully, but these errors were encountered: