Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions giraffe/src/components/SizedPlot.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,7 @@ describe('the SizedPlot', () => {
layerCanvasRef={layersRef}
/>
)
// when the user (for real) does a single click, then a mouse up happens.
// choose mouse up because the single click listener wasn't triggering except on
// double clicks
fireEvent.mouseUp(screen.getByTestId('giraffe-inner-plot'))
fireEvent.click(screen.getByTestId('giraffe-inner-plot'))

expect(resetSpy).not.toHaveBeenCalled()
expect(fakeSingleClickInteractionHandler).toHaveBeenCalled()
Expand Down
8 changes: 1 addition & 7 deletions giraffe/src/components/SizedPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ export const SizedPlot: FunctionComponent<Props> = ({
bottom: 0,
}

// for single clicking; using mouseup, since the onClick only gets through
// with a double click; and the hover and drag target does not use a mouse up;
// they are: hover: mouseEnter, mousemove, mouseleave
// drag target: mouseDown
// and every time there is a single click, the mouse goes up. so using that instead.

return (
<div
className="giraffe-plot"
Expand All @@ -150,7 +144,7 @@ export const SizedPlot: FunctionComponent<Props> = ({
left: `${margins.left}px`,
cursor: `${userConfig.cursor || 'crosshair'}`,
}}
onMouseUp={callbacks.singleClick}
onClick={callbacks.singleClick}
onDoubleClick={memoizedResetDomains}
{...hoverTargetProps}
{...dragTargetProps}
Expand Down