mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-05 03:19:52 +08:00
fix(editor): should not show inner toolbar of surface-ref in edgeless (#11453)
Closes: [BS-3015](https://linear.app/affine-design/issue/BS-3015/toolbar-有时会出现空状态且被显示) [BS-3023](https://linear.app/affine-design/issue/BS-3023/surface-ref-inner-toolbar-的标题圆角)
This commit is contained in:
@@ -70,9 +70,8 @@ export function autoUpdatePosition(
|
||||
offset(({ rects }) => -rects.floating.height),
|
||||
size({
|
||||
apply: ({ elements }) => {
|
||||
elements.floating.style.width = `${
|
||||
elements.reference.getBoundingClientRect().width
|
||||
}px`;
|
||||
const { width } = elements.reference.getBoundingClientRect();
|
||||
elements.floating.style.width = `${width}px`;
|
||||
},
|
||||
}),
|
||||
],
|
||||
@@ -126,12 +125,14 @@ export function autoUpdatePosition(
|
||||
|
||||
toolbar.style.transform = `translate3d(${x}px, ${y}px, 0)`;
|
||||
|
||||
if (toolbar.dataset.open) {
|
||||
if (middlewareData.hide?.referenceHidden) {
|
||||
delete toolbar.dataset.open;
|
||||
if (middlewareData.hide) {
|
||||
if (toolbar.dataset.open) {
|
||||
if (middlewareData.hide.referenceHidden) {
|
||||
delete toolbar.dataset.open;
|
||||
}
|
||||
} else {
|
||||
toolbar.dataset.open = 'true';
|
||||
}
|
||||
} else {
|
||||
toolbar.dataset.open = 'true';
|
||||
}
|
||||
};
|
||||
|
||||
@@ -239,6 +240,12 @@ export function renderToolbar(
|
||||
a => a.placement === ActionPlacement.More
|
||||
);
|
||||
|
||||
// Resets
|
||||
if (primaryActionGroup.length === 0) {
|
||||
context.reset();
|
||||
return;
|
||||
}
|
||||
|
||||
const innerToolbar = context.placement$.value === 'inner';
|
||||
|
||||
if (moreActionGroup.length) {
|
||||
@@ -289,6 +296,9 @@ export function renderToolbar(
|
||||
),
|
||||
toolbar
|
||||
);
|
||||
|
||||
if (toolbar.dataset.open) return;
|
||||
toolbar.dataset.open = 'true';
|
||||
}
|
||||
|
||||
function renderActions(
|
||||
|
||||
Reference in New Issue
Block a user