-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
Description:
When clicking the Edit button for a task, the input field that appears is empty and not focused. Users have to retype the task label from scratch.
Steps to Reproduce:
- Click the Edit button for a task with an existing label.
- Observe that the input field is empty and focus is not applied.
Expected Behavior:
The input field should be prefilled with the current task label and focused.
Root Cause (Code Snippet):
const editTask = () => {
setIsEditing((prevValue) => {
inputRef.current?.focus();
if (inputRef.current) {
inputRef.current.value = titleRef.current;
}
return !prevValue;
});
};
The issue occurs because the DOM element (inputRef.current) may not exist yet when setIsEditing toggles the state, causing focus and value assignment to fail.
Metadata
Metadata
Assignees
Labels
No labels