feat: mid click links to open in new tab (#7784)

fix AF-1200
This commit is contained in:
pengx17
2024-08-08 09:43:35 +00:00
parent fd6e198295
commit 7fca13076a
22 changed files with 163 additions and 78 deletions

View 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;
}

View File

@@ -1,4 +1,5 @@
export * from './create-emotion-cache';
export * from './event';
export * from './fractional-indexing';
export * from './popup';
export * from './string2color';