twenty
twenty copied to clipboard
Task name input field is buggy
Bug Description
When creating a task, the name field behaves in unexpected ways. The bug is visible when you try to clear the inputed text completely and it flickers. You need to press the backspace button a few times before the text is completely cleared.
https://github.com/twentyhq/twenty/assets/16918891/2ac35486-45a3-4ae2-b9ce-a6cd58de5973
Expected behavior
Clearing the input text for task name should be a smooth experience.
Technical inputs
This bug seems to be an accidental react state update bug.
I can take a look at this
Ok I spent some time on this. I did make a PR but I admit it's not a permanent solution.
The PR can be found here: https://github.com/twentyhq/twenty/pull/5080 with all the details.
To summarise the issue is in the ActivityTitle.tsx file. In the handleTitleChange handler the title input gets cached and based on the setTimeOut settings the cached input will replace the deleted input. Resetting the time out to 0 prevents that problem. This way there is not a delay and old data removed does not suddenly reappear.