Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Describe the bug
The problem is easily recoverable on desktop, but it presents an almost empty screen on mobile, looking like an error.
@mapk @jasmussen since fixing this is a matter of simply not clearing the selection anymore, by removing a single call to
@jorgefilipecosta is there any technical reason to clear the block selection?
The argument is this:
My opinion is that:
Another thing that popped up in discussion is being future proof: we might have a new "Site" tab very soon when we start seeing signs of FSE in the editor. I think this is yet even more of a reason to stop clearing block selection. If at some point in the future we will require moving the selection in the document because we switched tabs, only then it is a good time to implement a mechanism for remembering previous selection states and applying them.
Implementing such a mechanism today will most likely require a refactor when block areas and whatnot shall appear.
The final thing is that the inspector is contextual and I also disagree with that, the inspector tabs are contextual not the entire inspector. Similar to this, desktop software only have contextual toolbars or sidebars, never changing things you can't see (such as the block tab in our case).
One example, props to @noisysocks , which behaves similar is Apple Pages where switching inspector tabs, even to document, does not clear any selection in the document:
As another example, Blocs.app seems to clear the selection when clicking another tab but returns the selection when the tab is clicked back again.
If the selection in Gutenberg didn't clear, what would happen if I have a block selected and clicked the Document tab? Would I just see the Document settings, but the block would still remain selected? Looking at the example from @noisysocks, it may not be a bad decision.