fix: remove gear popper on root node
This commit is contained in:
parent
24e6084d48
commit
203c8d5f93
@ -630,13 +630,16 @@ function CsComponent({
|
|||||||
return crossElement;
|
return crossElement;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
let gearsPopper = null
|
||||||
const gearsPopper = node.popper({
|
console.log('POPE', node.data())
|
||||||
|
if (node.data().root !== true) {
|
||||||
|
gearsPopper = node.popper({
|
||||||
popper: {
|
popper: {
|
||||||
placement: "left",
|
placement: "left",
|
||||||
modifiers: [{ name: "flip", options: { boundary: node } }],
|
modifiers: [{ name: "flip", options: { boundary: node } }],
|
||||||
},
|
},
|
||||||
content: ([item]) => {
|
content: ([item]) => {
|
||||||
|
console.log('PEPO', item.id())
|
||||||
const itemId = item.id();
|
const itemId = item.id();
|
||||||
|
|
||||||
const itemElement = gearsContainer.current?.querySelector(
|
const itemElement = gearsContainer.current?.querySelector(
|
||||||
@ -658,11 +661,11 @@ function CsComponent({
|
|||||||
return gearElement;
|
return gearElement;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
}
|
||||||
const update = async () => {
|
const update = async () => {
|
||||||
await plusesPopper.update();
|
await plusesPopper.update();
|
||||||
await crossesPopper.update();
|
await crossesPopper.update();
|
||||||
await gearsPopper.update();
|
await gearsPopper?.update();
|
||||||
await layoutsPopper.update();
|
await layoutsPopper.update();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -691,7 +694,7 @@ function CsComponent({
|
|||||||
{ name: "offset", options: { offset: [0, 0 * zoom] } },
|
{ name: "offset", options: { offset: [0, 0 * zoom] } },
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
gearsPopper.setOptions({
|
gearsPopper?.setOptions({
|
||||||
modifiers: [
|
modifiers: [
|
||||||
{ name: "flip", options: { boundary: node } },
|
{ name: "flip", options: { boundary: node } },
|
||||||
{ name: "offset", options: { offset: [0, 0] } },
|
{ name: "offset", options: { offset: [0, 0] } },
|
||||||
@ -726,7 +729,7 @@ function CsComponent({
|
|||||||
element.style.borderRadius = `${6 * zoom}px`;
|
element.style.borderRadius = `${6 * zoom}px`;
|
||||||
});
|
});
|
||||||
|
|
||||||
gearsContainer.current
|
gearsContainer?.current
|
||||||
?.querySelectorAll("#popper-gears > .popper-gear")
|
?.querySelectorAll("#popper-gears > .popper-gear")
|
||||||
.forEach((item) => {
|
.forEach((item) => {
|
||||||
const element = item as HTMLDivElement;
|
const element = item as HTMLDivElement;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user