Repository navigation
fix(modals): keep separators when typing comma-separated tags - #2518
Merged
Merged
Conversation
The task modal syncs every control from the form after each edit. The tags field stores a sanitised value, which drops a trailing comma, so writing it back into the focused input erased the separator: typing "work, home" produced "workhome". Skip the write-back for the focused contexts and tags inputs, as user fields and time estimate already do, and show the sanitised tags when the field is left.
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 a regression from #2501 that blocks 4.17.0. If you type
work, homekeystroke by keystroke into the task create modal's Tags field, you getworkhome. Pasting the whole string works.Cause
After each form edit,
syncFormControlscopies the form's values back into the modal's controls. The tags field storessanitizeTags(value), which drops a trailing,, so as soon as you type the comma it is removed from the focused input.Change
syncFormControlsno longer overwrites the contexts or tags input while it has focus. User fields and time estimate already skip the focused input.Other fields checked
Tests
e2e/issues/pr-2501-tags-keystrokes.spec.ts: types tags and contexts keystroke by keystroke, and checks that tags are sanitised when the field loses focus. It fails on main ("workhome") and passes with this fix.task-modal,issue-2148,issue-2404andissue-2421: 26 passed.tests/unit/modalsand the tag-related issue tests: 299 passed.npm run lint,npm run typecheckandnpm run buildpass.Release notes
None added. No stable release has had #2501; 4.17.0 is the first. It did ship in the
5.0.0-beta.7prerelease, so the beta line needs this fix too.