Skip to content

Commit 02b2df1

Browse files
docs(stories): stop pin click propagation in image annotations example (#560)
Prevent click events from bubbling when placing a pin so the canvas click handler does not clear the current draft selection. Fixes #559 Co-authored-by: Giovanni Di Maggio <giovanni.dimaggio@digitouch.it>
1 parent 958de5c commit 02b2df1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/stories/examples/image-annotations/example.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,7 @@ function AnnotationCanvas(props: {
839839
const handlePinClick = useCallback(
840840
(e: React.MouseEvent) => {
841841
if (placeMode !== "pin") return;
842+
e.stopPropagation();
842843
const pt = clientToContent(
843844
e.clientX,
844845
e.clientY,

0 commit comments

Comments
 (0)