Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): fix active view with mouse (#6994)

EYHN7fddd14f72d1
diff --git a/packages/frontend/core/src/modules/workbench/view/workbench-root.tsx b/packages/frontend/core/src/modules/workbench/view/workbench-root.tsx
index 46b99481ff..d71654a204 100644
--- a/packages/frontend/core/src/modules/workbench/view/workbench-root.tsx
+++ b/packages/frontend/core/src/modules/workbench/view/workbench-root.tsx
@@ -64,11 +64,11 @@ const WorkbenchView = ({ view, index }: { view: View; index: number }) => {
useEffect(() => {
if (containerRef.current) {
const element = containerRef.current;
- element.addEventListener('mousedown', handleOnFocus, {
+ element.addEventListener('pointerdown', handleOnFocus, {
capture: true,
});
return () => {
- element.removeEventListener('mousedown', handleOnFocus, {
+ element.removeEventListener('pointerdown', handleOnFocus, {
capture: true,
});
};