-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Try a new hover and select approach to improve nested block selection #6773
Changes from 13 commits
44ca18f
12be2f9
aa2ea9f
62d412e
1d2ca61
a31b30d
7488a96
696ce2f
feaa3f0
9bb97aa
f527cf4
8e12ea7
3bcec0f
29e1792
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,9 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import classnames from 'classnames'; | ||
|
||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { compose, Component } from '@wordpress/element'; | ||
import { IconButton, Toolbar } from '@wordpress/components'; | ||
import { withDispatch, withSelect } from '@wordpress/data'; | ||
import { __ } from '@wordpress/i18n'; | ||
import { compose, Component, Fragment } from '@wordpress/element'; | ||
import { Toolbar } from '@wordpress/components'; | ||
import { withSelect } from '@wordpress/data'; | ||
|
||
/** | ||
* Internal dependencies | ||
|
@@ -53,22 +47,16 @@ export class BlockBreadcrumb extends Component { | |
} | ||
|
||
render( ) { | ||
const { uid, rootUID, selectRootBlock, isHidden } = this.props; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we're not using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Removed in 11d7161. |
||
const { isFocused } = this.state; | ||
const { uid, rootUID } = this.props; | ||
|
||
return ( | ||
<div className={ classnames( 'editor-block-list__breadcrumb', { | ||
'is-visible': ! isHidden || isFocused, | ||
} ) }> | ||
<div className={ 'editor-block-list__breadcrumb' }> | ||
<Toolbar> | ||
{ rootUID && ( | ||
<IconButton | ||
onClick={ selectRootBlock } | ||
onFocus={ this.onFocus } | ||
onBlur={ this.onBlur } | ||
label={ __( 'Select parent block' ) } | ||
icon="arrow-left-alt" | ||
/> | ||
<Fragment> | ||
<BlockTitle uid={ rootUID } /> | ||
<span className="editor-block-list__descendant-arrow" /> | ||
</Fragment> | ||
) } | ||
<BlockTitle uid={ uid } /> | ||
</Toolbar> | ||
|
@@ -86,12 +74,4 @@ export default compose( [ | |
rootUID: getBlockRootUID( uid ), | ||
}; | ||
} ), | ||
withDispatch( ( dispatch, ownProps ) => { | ||
const { rootUID } = ownProps; | ||
const { selectBlock } = dispatch( 'core/editor' ); | ||
|
||
return { | ||
selectRootBlock: () => selectBlock( rootUID ), | ||
}; | ||
} ), | ||
] )( BlockBreadcrumb ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change seems to have inadvertently caused #7127, where the stylesheet is used for both the editor and front-end, but the markup generated from the front-end will not have
.editor-inner-blocks
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking.