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

Inserter: Try making the inline tokens less important #8587

Merged
merged 3 commits into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/editor/src/components/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ export class InserterMenu extends Component {
role="region"
aria-label={ __( 'Available block types' ) }
>
<InserterResultsPortal.Slot fillProps={ { filterValue } } />

<ChildBlocks
rootClientId={ rootClientId }
Expand Down Expand Up @@ -248,6 +247,9 @@ export class InserterMenu extends Component {
</PanelBody>
);
} ) }

<InserterResultsPortal.Slot fillProps={ { filterValue } } />

{ !! reusableItems.length && (
<PanelBody
title={ __( 'Reusable' ) }
Expand Down
4 changes: 3 additions & 1 deletion packages/editor/src/components/inserter/results-portal.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { searchItems } from './menu';

const { Fill, Slot } = createSlotFill( 'InserterResultsPortal' );

const InserterResultsPortal = ( { items, title, onSelect, onHover } ) => {
const InserterResultsPortal = ( { items, title, onSelect, onHover, ...props } ) => {
return (
<Fill>
{ ( { filterValue } ) => {
Expand All @@ -24,6 +24,8 @@ const InserterResultsPortal = ( { items, title, onSelect, onHover } ) => {
return (
<PanelBody
title={ title }
{ ...props }
className="editor-inserter__results-portal"
>
<BlockTypesList items={ filteredItems } onSelect={ onSelect } onHover={ onHover } />
</PanelBody>
Expand Down
9 changes: 4 additions & 5 deletions packages/editor/src/components/inserter/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ $block-inserter-search-height: 38px;
}
}

.editor-inserter__results-portal {
margin-top: -1px;
}

.editor-inserter__menu.is-bottom:after {
border-bottom-color: $white;
}
Expand Down Expand Up @@ -101,11 +105,6 @@ $block-inserter-search-height: 38px;
[role="presentation"] + .components-panel__body {
border-top: none;
}

// Don't show the bottom border on the last panel, let the library itself show the border.
.components-panel__body:last-child {
border-bottom: none;
}
}

.editor-inserter__popover .editor-block-types-list {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class TokenUI extends Component {
items={ this.props.items }
onSelect={ this.onSelect }
onHover={ this.onHover }
initialOpen={ false }
/>
{ hovered &&
<div
Expand Down