Skip to content

Commit

Permalink
fix(PageLayout): update onMouseDown to check which button is pressed (#…
Browse files Browse the repository at this point in the history
…4022)

* fix(PageLayout): update onMouseDown to check which button is pressed

* chore: add changeset

---------

Co-authored-by: Josh Black <joshblack@users.noreply.github.com>
  • Loading branch information
joshblack and joshblack authored Dec 5, 2023
1 parent 3f82a1c commit 98ad320
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/warm-sloths-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

Update the resize behavior of PageLayout to ignore right clicks when resizing
8 changes: 5 additions & 3 deletions src/PageLayout/PageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,11 @@ const VerticalDivider: React.FC<React.PropsWithChildren<DividerProps & Draggable
aria-valuenow={currentWidth}
aria-valuetext={`Pane width ${currentWidth} pixels`}
tabIndex={0}
onMouseDown={() => {
setIsDragging(true)
onDragStart?.()
onMouseDown={event => {
if (event.button === 0) {
setIsDragging(true)
onDragStart?.()
}
}}
onKeyDown={event => {
if (
Expand Down

0 comments on commit 98ad320

Please sign in to comment.