mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
14
packages/frontend/core/src/utils/event.ts
Normal file
14
packages/frontend/core/src/utils/event.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { BaseSyntheticEvent } from 'react';
|
||||
|
||||
export function stopPropagation(event: BaseSyntheticEvent) {
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
export function stopEvent(event: BaseSyntheticEvent) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
export function isNewTabTrigger(event?: React.MouseEvent) {
|
||||
return event ? event.ctrlKey || event.metaKey || event.button === 1 : false;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
export * from './create-emotion-cache';
|
||||
export * from './event';
|
||||
export * from './fractional-indexing';
|
||||
export * from './popup';
|
||||
export * from './string2color';
|
||||
|
||||
Reference in New Issue
Block a user