Skip to content

Commit

Permalink
Merge pull request #3566 from udecode/hover-selection
Browse files Browse the repository at this point in the history
Fix width issues caused by hover scrollbars.
  • Loading branch information
felixfeng33 authored Sep 23, 2024
2 parents f83cd77 + f5d49b3 commit da72fc6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-zoos-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@udecode/plate-selection': patch
---

Fix width issues caused by hover scrollbars.
2 changes: 1 addition & 1 deletion apps/www/src/registry/default/example/playground-demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ export default function PlaygroundDemo({
variant="ghost"
className={cn(
editableProps.className,
' overflow-x-hidden px-[var(--editor-px)]',
'overflow-x-auto px-[var(--editor-px)]',
!id && 'pb-[20vh] pt-4',
id && 'pb-8 pt-2'
)}
Expand Down
8 changes: 4 additions & 4 deletions packages/selection/src/internal/SelectionArea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,16 @@ export class SelectionArea extends EventTarget<SelectionEvents> {
speedDivider: 10,
...opt.behaviour?.scrolling,
startScrollMargins: {
x: 0,
y: 0,
x: 20,
y: 20,
...opt.behaviour?.scrolling?.startScrollMargins,
},
},
startThreshold: opt.behaviour?.startThreshold
? typeof opt.behaviour.startThreshold === 'number'
? opt.behaviour.startThreshold
: { x: 10, y: 10, ...opt.behaviour.startThreshold }
: { x: 10, y: 10 },
: { x: 20, y: 20, ...opt.behaviour.startThreshold }
: { x: 20, y: 20 },
},

features: {
Expand Down

0 comments on commit da72fc6

Please sign in to comment.