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

Chrome: Unselect blocks when opening the document settings #6936

Merged
merged 1 commit into from
May 24, 2018

Conversation

youknowriad
Copy link
Contributor

closes #6887

Testing instructions

  • Select a block
  • This shows the block inspector
  • Click "Document"
  • This unselects the block

@youknowriad youknowriad self-assigned this May 24, 2018
@youknowriad youknowriad requested a review from jasmussen May 24, 2018 11:33
Copy link
Contributor

@jasmussen jasmussen left a comment

Choose a reason for hiding this comment

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

Nice! Works as intended.

I can't review the code, but the experience feels right 👍 👍

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

👍

const { openGeneralSidebar } = dispatch( 'core/edit-post' );
const { clearSelectedBlock } = dispatch( 'core/editor' );
return {
openDocumentSettings: () => {
Copy link
Member

Choose a reason for hiding this comment

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

You can use object function shorthand:

return {
	openDocumentSettings() { ... },
	openBlockSettings() { ... },
};

@youknowriad youknowriad force-pushed the unselect-on-document-select branch from ca1cc48 to 58f0a68 Compare May 24, 2018 11:47
@youknowriad youknowriad merged commit 9a7bbe6 into master May 24, 2018
@youknowriad youknowriad deleted the unselect-on-document-select branch May 24, 2018 12:04
@youknowriad youknowriad added this to the 3.0 milestone May 30, 2018
@afercia
Copy link
Contributor

afercia commented Jun 6, 2018

@youknowriad quick question: would it be easy to re-select the previously selected block when clicking "Block" after "Document" has been clicked?

@youknowriad
Copy link
Contributor Author

@afercia We'd have to store this information somewhere, we don't have it at the moment.

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.

Selecting the Document tab should deselect blocks.
4 participants