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

Only sync the content of the advanced and visual synonyms editors on submit or switch. Fixes #2392. #2411

Merged
merged 4 commits into from
Oct 19, 2021

Conversation

JakePT
Copy link
Contributor

@JakePT JakePT commented Oct 15, 2021

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:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Applicable Issues

#2392

Changelog Entry

Fixes an issue where it would not be possible to type into the Advanced Synonym Editor under certain conditions.

@JakePT JakePT linked an issue Oct 15, 2021 that may be closed by this pull request
@felipeelia felipeelia self-assigned this Oct 18, 2021
@felipeelia felipeelia added this to the 3.6.4 milestone Oct 18, 2021
@felipeelia felipeelia merged commit 9afda89 into develop Oct 19, 2021
@felipeelia felipeelia deleted the fix/2392 branch October 19, 2021 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Advanced synonyms textarea limited to 20 lines
2 participants