From 98ad3203a33c9caf2579474fa517a0c7a2ba8924 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Tue, 5 Dec 2023 16:27:00 -0600 Subject: [PATCH] fix(PageLayout): update onMouseDown to check which button is pressed (#4022) * fix(PageLayout): update onMouseDown to check which button is pressed * chore: add changeset --------- Co-authored-by: Josh Black --- .changeset/warm-sloths-tickle.md | 5 +++++ src/PageLayout/PageLayout.tsx | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .changeset/warm-sloths-tickle.md diff --git a/.changeset/warm-sloths-tickle.md b/.changeset/warm-sloths-tickle.md new file mode 100644 index 00000000000..1a300487110 --- /dev/null +++ b/.changeset/warm-sloths-tickle.md @@ -0,0 +1,5 @@ +--- +'@primer/react': patch +--- + +Update the resize behavior of PageLayout to ignore right clicks when resizing diff --git a/src/PageLayout/PageLayout.tsx b/src/PageLayout/PageLayout.tsx index 378d8fe8c3d..7b18f7bf0b4 100644 --- a/src/PageLayout/PageLayout.tsx +++ b/src/PageLayout/PageLayout.tsx @@ -352,9 +352,11 @@ const VerticalDivider: React.FC { - setIsDragging(true) - onDragStart?.() + onMouseDown={event => { + if (event.button === 0) { + setIsDragging(true) + onDragStart?.() + } }} onKeyDown={event => { if (