Skip to content
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

5077: fix buggy title input reappearing after delete #5080

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlexVascon
Copy link

Full disclosure this is not a permanent solution. I did spend a lot of time on it and have pinpointed the issue area. It took me some time to get it to run locally properly. Unfortunately I could not get graphql to work, limiting some functionality. For example in the issue video the note automatically renders in the notes list as you are creating the note. Since I could not get the graphql extension to work for some reason I did not have this functionality which can effect result.

However the debounce is more to do with stopping something from triggering too often., so the title state still remains and will show up in both places. It's just the input gets cached and when you delete it, it reappears moments later because of the cashing solution. The fact is trying to create a title and being unable to delete it without some challenge is rather annoying.

The issue is in the ActivityTitle.tsx file. In the handleTitleChange function.

const handleTitleChange = (newTitle: string) => {
setActivityTitle(newTitle);

setTitleDebounced(newTitle);

persistTitleDebounced(newTitle);

};

in the setTitleDebounced function I set the timeout to 0. This allowed me to delete characters by ether pressing delete or holding the delete button, without the whole text reappearing. I did not have to edit the persistTitleDebounced.

Copy link

Welcome!

Hello there, congrats on your first PR! We're excited to have you contributing to this project.
By submitting your Pull Request, you acknowledge that you agree with the terms of our Contributor License Agreement.

Generated by 🚫 dangerJS against e5f9e3e

@lucasbordeau lucasbordeau self-requested a review May 1, 2024 13:24
@lucasbordeau lucasbordeau self-assigned this May 1, 2024
@lucasbordeau
Copy link
Contributor

Hi @AlexVascon could you link the related issue ?

@lucasbordeau
Copy link
Contributor

This area is not well finished yet, debouncing introduces some complexities that are not fully handled in a deterministic manner yet, as you found out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants