Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: skeleton change will remove autofill popupmenu #2092

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,16 @@ export const AutoFillPopupMenu: React.FC<{}> = () => {
return disposable.dispose;
}, [forceUpdate, commandService]);

useEffect(() => {
const disposable = toDisposable(
sheetSkeletonManagerService.currentSkeleton$.subscribe((skeleton) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

引起 skeleton change 的事件有很多,确认都要关闭吗?协同场景下会不会有问题?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

确实,协同带来的 skeleton change 应该只刷新位置,不会导致按钮关闭。这里我把它改成监听一些本地Mutation才导致关闭。

if (skeleton) {
setAnchor({ row: -1, col: -1 });
}
}));
return disposable.dispose;
}, [sheetSkeletonManagerService]);

useEffect(() => {
const disposable = toDisposable(
autoFillService.menu$.subscribe((menu) => {
Expand Down
Loading