Open ozakharchenko02100 opened 3 days ago
Hello!
A TextField rebuilds differently compared to a Text Widget, which can lead to some delays like the one shown in your video. Instead of setting the "Initial Value" through a query, I highly recommend using an action to handle this more effectively.
For example, when selecting a specific date, use the "Set Form Field" action to directly update the value of the TextField. This approach avoids relying on a rebuild to update the initial value, which may cause delays—such as the behavior you’re experiencing, where clicking on "20" does nothing, but clicking "19" shows "20" (lagging behind by one rebuild).
This method should ensure smoother updates without the delay. Let me know if you need more details or assistance with implementing this!
I followed your advice and removed the 'Initial Value' using a query. I also set up a 'Set Form Field' action to directly update the value, but it still doesn't work. Please check the video https://www.loom.com/share/3ce8275f07b64a828a1078074c31bac1 @Alezanello
Interesting observation!
I checked your project, and one approach you could take is to set the User_notes collection query to Single-Time Query and use a Refresh Database Request action whenever updates are needed.
For example:
In the Action Flow for selecting a date, instead of using the Wait Action for 700ms, you can replace it with a Refresh Database Request action and enable the Wait for result option. This ensures the system waits until all data is refreshed. Then, set the form field with the updated query results, ensuring you’re always working with the latest information from the database.
@Alezanello I used your solutions, but it seems like FlutterFlow is still displaying data from the previous data reference.
Something doesn’t seem quite right. The "Set Form Field" is definitely pulling data from the most recent database query, but the issue seems to be related to when the text field is being rebuilt.
Let’s try this: after the "Set Form Field" action, add an "Update AppState" action. Don’t update anything in the AppState, but be sure to select the "Rebuild Containing Page" option.
Let me know if this resolves the issue!
@Alezanello unfortunately, it didn't resolve my issue :(
@Alezanello Do you have any other idea how this issue can be resolved?
One last chance, put another AppState BEFORE the Set Form Field, and put "Rebuild All Pages" in both.
@Alezanello unfortunately it didn't change the TextField value to the correct one. Please check out the video: https://www.loom.com/share/5dd3a31de66d4f4089f843c5c105bbf9
Sorry to this being repetitive, could you do the same video but when you are showing me the behavior, scroll down the Debug Panel where it shows the variables to the values of the query returned to set on the Field?
Yes, of course
Hello @Alezanello. Thank you for your help so far. I appreciate your efforts. I was wondering if there might be another solution or approach we could try to resolve this issue?
At this point, I’m out of options as to why this issue might be occurring. I recommend reaching out to our support team via in-app chat or at support@flutterflow.io for further assistance.
Thank you for the patience
Can we access your project?
Current Behavior
The TextField doesn't show the correct data from the single query, but the text appears correctly in the component popupCalendar.
Expected Behavior
The TextField should display the correct data from the query, just like it appears in the text in the popupCalendar component.
Steps to Reproduce
Steps to Reproduce:
Reproducible from Blank
Bug Report Code (Required)
ITEelPLq5YxJpbxI0M7Iae5VowMwHVgjbJ0vpe5+dwsjCeOqEZoXds/Bdk5WcuqHYXNPek79kkYEwdL2joTxL/UqPTWtGZhl/pNpUxDiYzuQVq6OCqmSVkQlQP9PCBGf4aaFuglDJvZiSVJh3TqmFvO+a3qCf9qOYwx5e6fDbOY=
Visual documentation
https://www.loom.com/share/15d187f3bd5140238130f84f60055cd1 https://www.loom.com/share/999b27c3717d4b2581ce60cf3621e562
Environment
Additional Information
We have already tried to set the value in the app and component states. Convert to the component element, but still, it doesn't work