Skip to content

Commit bad9747

Browse files
fix: keep the components original position in Inspector (#1127)
The solution is taken from Otter Blocks.
1 parent 7cbb02e commit bad9747

File tree

2 files changed

+846
-931
lines changed

2 files changed

+846
-931
lines changed

js/FeedzyBlock/Editor.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import Inspector from './inspector';
1515
import { __, sprintf } from '@wordpress/i18n';
1616
import apiFetch from '@wordpress/api-fetch';
1717
import { Component, Fragment } from '@wordpress/element';
18+
import { InspectorControls } from '@wordpress/block-editor';
1819
import {
1920
unescapeHTML,
2021
filterData,
@@ -425,9 +426,17 @@ class Editor extends Component {
425426
render() {
426427
return (
427428
<Fragment>
428-
{'fetched' === this.state.route && (
429-
<Inspector edit={this} state={this.state} {...this.props} />
430-
)}
429+
<InspectorControls key="inspector">
430+
<div>
431+
{'fetched' === this.state.route && (
432+
<Inspector
433+
edit={this}
434+
state={this.state}
435+
{...this.props}
436+
/>
437+
)}
438+
</div>
439+
</InspectorControls>
431440
{'home' === this.state.route && (
432441
<div className={this.props.className}>
433442
<Placeholder

0 commit comments

Comments
 (0)