Fix expanding of selected item
Summary: Changelog: Layout plugin: fixed automatic expanding of layout tree when a deep element selected in the target mode. Reviewed By: passy Differential Revision: D26577751 fbshipit-source-id: 9f4a074d114892d6903a58e1ed44cf580cf1d432
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c010e22612
commit
ded38d7869
@@ -335,6 +335,9 @@ export default class Inspector extends Component<Props, State> {
|
|||||||
|
|
||||||
async getAndExpandPath(path: Array<ElementID>) {
|
async getAndExpandPath(path: Array<ElementID>) {
|
||||||
await Promise.all(path.map((id) => this.getChildren(id, {})));
|
await Promise.all(path.map((id) => this.getChildren(id, {})));
|
||||||
|
for (const id of path) {
|
||||||
|
this.updateElement(id, {expanded: true});
|
||||||
|
}
|
||||||
this.onElementSelected()(path[path.length - 1]);
|
this.onElementSelected()(path[path.length - 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user