Repository navigation
Stop Account Name and Username refilling after they are cleared - #452
Open
Gabriel-Dalton wants to merge 1 commit into
Open
Gabriel-Dalton wants to merge 1 commit into
Gabriel-Dalton wants to merge 1 commit into
Conversation
The auto-fill effect read name and username to check whether they were empty, which made them dependencies of the effect. Clearing either field re-ran the effect and filled it straight back in, so the field could not be emptied or retyped from scratch. Read them untracked, and only overwrite a name the form filled in itself. As a side effect the name now follows the email while it is typed, instead of sticking at the first letter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #451.
Problem
In Add Account, clearing Account Name (or Username) makes it fill itself straight back in, so the field cannot be emptied or retyped from scratch.
The auto-fill
$effectinAccountForm.sveltereadsnameandusernameto check whether they are empty. In Svelte 5 that makes them dependencies of the effect, so clearing either one re-runs it and it refills the field.Change
name,usernameandprevEmailwithuntrack, so editing those fields never re-runs the auto-fill. It still runs when the email changes.prevAutoName) and only overwrite a name that is empty or still equal to it. A name the user typed is never replaced.Side effect: the name now follows the email while it is being typed. Before, typing the address one character at a time left the name stuck at the first letter, because the field was no longer empty after the first keystroke.
Edit mode is unaffected: the loaded account name differs from
prevAutoName, so it is kept.Checks
svelte-check: 0 errors, 0 warningseslinton the file: cleanwails buildon Windows 11: builds