Skip to content

Commit

Permalink
feat: touch with two fingers to close the splitte
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-musallam committed Sep 27, 2023
1 parent cc8332a commit 09e7913
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/split-pane/SplitPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,19 @@ function Splitter(props: SplitterProps) {
isFinalClosed,
splitterRef,
} = props;

function handleTouch(event: React.TouchEvent<HTMLDivElement>) {
if (event.targetTouches.length === 2) {
onDoubleClick();
}
}
return (
<div
onDoubleClick={onDoubleClick}
onPointerDown={onPointerDown}
css={getSeparatorStyle(direction, !isFinalClosed)}
ref={splitterRef}
onTouchStart={handleTouch}
>
<div style={{ fontSize: '0.875em' }}>
{direction === 'horizontal' ? <span></span> : <span></span>}
Expand Down

0 comments on commit 09e7913

Please sign in to comment.