mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
fix(editor): 修复部分场景下获取不到region的情况 (#10354)
Co-authored-by: qinhaoyan <30946345+qinhaoyan@users.noreply.github.com>
This commit is contained in:
parent
f6f274b6d7
commit
1064425e3b
@ -218,12 +218,14 @@ export default class Breadcrumb extends React.Component<
|
||||
const nearby: Array<EditorNodeType> = (
|
||||
item.parent as EditorNodeType
|
||||
)?.uniqueChildren;
|
||||
|
||||
const region =
|
||||
item.region ||
|
||||
item.childRegions.find((i: any) => i.region)?.region;
|
||||
return (
|
||||
<li key={index}>
|
||||
<span
|
||||
data-node-id={item.id}
|
||||
data-node-region={item.region}
|
||||
data-node-region={region}
|
||||
onClick={this.handleClick}
|
||||
onMouseEnter={this.handleMouseEnter}
|
||||
>
|
||||
|
@ -260,6 +260,7 @@ export class BasicToolbarPlugin extends BasePlugin {
|
||||
const node = store.getNodeById(id)!;
|
||||
const paths = store.getNodePathById(id);
|
||||
const first = paths.pop()!;
|
||||
region = region || node.childRegions.find(i => i.region)?.region;
|
||||
const host = node.host as EditorNodeType;
|
||||
const regionNode = node.parent as EditorNodeType;
|
||||
|
||||
@ -279,7 +280,7 @@ export class BasicToolbarPlugin extends BasePlugin {
|
||||
id: 'unselect',
|
||||
label: '取消多选',
|
||||
icon: 'cancel-icon',
|
||||
onSelect: () => store.setActiveId(id)
|
||||
onSelect: () => store.setActiveId(id, region)
|
||||
});
|
||||
|
||||
menus.push({
|
||||
|
Loading…
Reference in New Issue
Block a user