Bugfix: Editor grabs focus on realignment even if editor not in focus #189
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.
Describe what the PR does
After word realignment, the editor needs to set the focus again on the previous focus position. At the moment, this is also the case if the user has the focus not in the editor. In that case, the editor grabs the current focus away from whatever the user is doing, which is quite annoying.
State whether the PR is ready for review or whether it needs extra work
This PR fixes this problem by checking if the editor has focus at the time. If not, the focus will not be set back to the previous focus position
Additional context
The bug can be observed in the demo application: start the player and open the drop-down for importing or exporting transcripts. The focus will switch back to the player, making it hard to select a new setting.