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

fix: reset selection on blur #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

christianhg
Copy link
Collaborator

@christianhg christianhg commented Jun 26, 2024

selection-bug-demo.mov

Make a selection:
Screenshot 2024-06-26 at 15 34 46

And then blur the editor:
Screenshot 2024-06-26 at 15 34 19

Before this change, the selection would be persisted after blurring the editor. This would make the toolbar still function:
Screenshot 2024-06-26 at 15 34 48

The problem is (unsurprisingly) also present in the Studio (notice the selected "B" in the blurred editor):
Screenshot 2024-06-26 at 15 37 23

Copy link
Contributor

@skogsmaskin skogsmaskin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There could be an issue here I think in regard to embedded dialogs and similar.

For instance, if you open a modal from a void block, you would want the void block to still be selected in the editor. So when you close the modal, you return to where you were (void block selected) without having to keep track of the previous selection. I have a feeling that this will completely wipe out that selection and put the selection to the top of the editor when it's refocused?

@christianhg
Copy link
Collaborator Author

There could be an issue here I think in regard to embedded dialogs and similar.

For instance, if you open a modal from a void block, you would want the void block to still be selected in the editor. So when you close the modal, you return to where you were (void block selected) without having to keep track of the previous selection. I have a feeling that this will completely wipe out that selection and put the selection to the top of the editor when it's refocused?

This is a really good point. I'll have to thoroughly test this change in the Studio before I actually merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants