mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-24 04:27:27 +08:00
fix(electron): split view indicator should show menu on click (#10089)
fix AF-2208
This commit is contained in:
@@ -19,12 +19,16 @@ export interface SplitViewDragHandleProps
|
|||||||
export const SplitViewDragHandle = memo(
|
export const SplitViewDragHandle = memo(
|
||||||
forwardRef<HTMLDivElement, SplitViewDragHandleProps>(
|
forwardRef<HTMLDivElement, SplitViewDragHandleProps>(
|
||||||
function SplitViewDragHandle(
|
function SplitViewDragHandle(
|
||||||
{ className, active, open, onOpenMenu, dragging, ...attrs },
|
{ className, active, open, onOpenMenu, dragging, onClick, ...attrs },
|
||||||
ref
|
ref
|
||||||
) {
|
) {
|
||||||
const onClick: MouseEventHandler = useCallback(() => {
|
const handleOnClick: MouseEventHandler<HTMLDivElement> = useCallback(
|
||||||
!open && onOpenMenu?.();
|
e => {
|
||||||
}, [onOpenMenu, open]);
|
!open && onOpenMenu?.();
|
||||||
|
onClick?.(e);
|
||||||
|
},
|
||||||
|
[onOpenMenu, open, onClick]
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -33,7 +37,7 @@ export const SplitViewDragHandle = memo(
|
|||||||
data-dragging={dragging}
|
data-dragging={dragging}
|
||||||
data-testid="split-view-indicator"
|
data-testid="split-view-indicator"
|
||||||
className={clsx(className, styles.indicator)}
|
className={clsx(className, styles.indicator)}
|
||||||
onClick={onClick}
|
onClick={handleOnClick}
|
||||||
{...attrs}
|
{...attrs}
|
||||||
>
|
>
|
||||||
<div className={styles.indicatorGradient} />
|
<div className={styles.indicatorGradient} />
|
||||||
|
|||||||
Reference in New Issue
Block a user