Skip to content

Commit 0b9be46

Browse files
committed
fix block selection
1 parent 2d676d4 commit 0b9be46

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/slow-coins-shout.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@udecode/plate-selection': patch
3+
---
4+
5+
Fix: clicking the left or right padding of the editor did not deselect.

apps/www/src/registry/default/components/editor/plugins/block-selection-plugins.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const blockSelectionPlugins = [
1010
scrolling: {
1111
speedDivider: 1.5,
1212
},
13-
startThreshold: 10,
13+
startThreshold: 4,
1414
},
1515
boundaries: '#scroll_container',
1616
container: '#scroll_container',

packages/selection/src/react/utils/onChangeBlockSelection.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const onChangeBlockSelection: OnChange<BlockSelectionConfig> = ({
1111
}) => {
1212
if (
1313
editor.selection &&
14-
getOptions().isSelecting &&
14+
getOptions().selectedIds!.size > 0 &&
1515
!editor.getOption(BlockMenuPlugin, 'openId')
1616
) {
1717
api.blockSelection.unselect();

0 commit comments

Comments
 (0)