dream-num / univer

Univer is a full-stack productivity dev kit helping you integrate spreadsheets, docs and slides into your systems.
https://univer.ai
Apache License 2.0
6.98k stars 610 forks source link

[Bug] Use addFloatDomToPosition to add floating dom, and add the policy to the first sheet to follow the table scrolling. But switching to the floating dom added by the second sheet cannot follow the table scrolling. #3927

Open hyman928 opened 4 hours ago

hyman928 commented 4 hours ago

在您提交此问题之前,您是否检查了以下内容?

受影响的包和版本

0.2.15

复现链接

const univerAPI = univerSheetRef.value?.getUniverAPI();
const activeWorkbook = univerAPI?.getActiveWorkbook();
const activeSheet = activeWorkbook?.getActiveSheet();

activeSheet.addFloatDomToPosition({ componentKey: ChartRenderWrapper, initPosition: { startX: left endX: left + width, startY: top, endY: top + height, }, data: {}, isVue3: true, allowTransform: true, })

预期行为

无论是哪个sheet表,添加浮动dom都能跟随表格滚动

实际行为

第一个sheet表添加的浮动dom能滚动。在第二个sheet表添加的就无法滚动,整个悬浮了

运行环境

Chrome

系统信息

System: OS: macOS 14.5 CPU: (8) arm64 Apple M1 Memory: 72.36 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node Yarn: 1.22.22 - ~/.nvm/versions/node/v18.18.2/bin/yarn npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm pnpm: 9.1.4 - ~/.nvm/versions/node/v18.18.2/bin/pnpm Browsers: Chrome: 130.0.6723.70 Safari: 17.5

univer-bot[bot] commented 4 hours ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

Origin Title: [Bug] 使用addFloatDomToPosition添加浮动dom,在第一个sheet表添加能政策跟随表格滚动。但是切换到第二个sheet表添加的浮动dom,无法跟随表格滚动

Title: [Bug] Use addFloatDomToPosition to add floating dom, and add the policy to the first sheet to follow the table scrolling. But switching to the floating dom added by the second sheet cannot follow the table scrolling.


Before you submitted this question, did you check the following?

Affected packages and versions

0.2.15

Recurrence link

const univerAPI = univerSheetRef.value?.getUniverAPI();
const activeWorkbook = univerAPI?.getActiveWorkbook();
const activeSheet = activeWorkbook?.getActiveSheet();

activeSheet.addFloatDomToPosition({ componentKey: ChartRenderWrapper, initPosition: { startX: left endX: left + width, startY: top, endY: top + height, }, data: {}, isVue3: true, allowTransform: true, })

Expected behavior

No matter which sheet it is, adding floating dom can follow the table scrolling

Actual behavior

The floating dom added to the first sheet can be scrolled. What is added in the second sheet cannot be scrolled, and the entire sheet is suspended.

Running environment

Chrome

System information

System: OS: macOS 14.5 CPU: (8) arm64 Apple M1 Memory: 72.36 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node Yarn: 1.22.22 - ~/.nvm/versions/node/v18.18.2/bin/yarn npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm pnpm: 9.1.4 - ~/.nvm/versions/node/v18.18.2/bin/pnpm Browsers: Chrome: 130.0.6723.70 Safari: 17.5

jikkai commented 3 hours ago

The provided information isn't enough to understand the issue. Please provide a minimal reproduction.