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

Bugfix: Editor grabs focus on realignment even if editor not in focus #189

Merged
merged 1 commit into from
Aug 16, 2019

Conversation

murezzda
Copy link
Contributor

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.

@pietrop pietrop merged commit 8500b11 into bbc:master Aug 16, 2019
@pietrop
Copy link
Contributor

pietrop commented Aug 16, 2019

Looks good, thanks @murezzda, was also able to verify locally both on demo and branch the difference.

@pietrop
Copy link
Contributor

pietrop commented Aug 16, 2019

I've also updated the changes to @bbc/react-transcript-editor@1.0.7 and the demo in storybook accordingly.

@pietrop pietrop self-requested a review August 16, 2019 14:20
@pietrop pietrop added the bug Something isn't working label Aug 16, 2019
@murezzda
Copy link
Contributor Author

Hi Pietro. Thanks for the promt response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants