Only sync the content of the advanced and visual synonyms editors on submit or switch. Fixes #2392. #2411
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.
Description of the Change
This change fixes an issue where it would not be possible to type into the Advanced Synonym Editor under certain conditions. For example, pressing space at the end of a line could remove that space and move the cursor to the end, or it would become impossible to add a new line by pressing return.
This was happening because the text content of the advanced editor was being converted into tokens for the visual editor on every change, so any new character that was added that would be removed by that process would be removed immediately and the cursor moved to the end.
This changes the behaviour so that the data conversion between the Visual and Advanced editors only occurs when switching between the two editors and when pressing Update Synonyms.
The change also adds validation messages to the Advanced editor, as it is now possible to submit the Advanced editor in an invalid state.
Benefits
The Advanced editor was essentially unusable with the original behaviour. This change makes it behave as a user would expect.
Possible Drawbacks
Since the Advanced editor is now more free-form it may be possible to put it into a state that may not work, however I have not been able to get this to happen, and am not aware of any conditions that would cause a problem.
Verification Process
When using the Advanced editor any text that is entered should appear uninterrupted, and any changes in each editor should be reflected when switching between them.
Checklist:
Applicable Issues
#2392
Changelog Entry
Fixes an issue where it would not be possible to type into the Advanced Synonym Editor under certain conditions.