fix selectOnDrag for Svelte Flow
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
Custom Color Picker Node: <strong>{bg.color}</strong>
|
Custom Color Picker Node: <strong>{bg.color}</strong>
|
||||||
</div>
|
</div>
|
||||||
<input
|
<input
|
||||||
class="nodrag"
|
class="nodrag nokey"
|
||||||
type="color"
|
type="color"
|
||||||
oninput={(evt) => (bg.color = evt.currentTarget.value)}
|
oninput={(evt) => (bg.color = evt.currentTarget.value)}
|
||||||
value={bg.color}
|
value={bg.color}
|
||||||
|
|||||||
@@ -97,12 +97,18 @@
|
|||||||
const isNoKeyEvent =
|
const isNoKeyEvent =
|
||||||
event.target !== container && !!(event.target as HTMLElement).closest('.nokey');
|
event.target !== container && !!(event.target as HTMLElement).closest('.nokey');
|
||||||
|
|
||||||
|
const isSelectionActive =
|
||||||
|
(selectionOnDrag && container === event.target) ||
|
||||||
|
!selectionOnDrag ||
|
||||||
|
store.selectionKeyPressed;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!store.elementsSelectable ||
|
!store.elementsSelectable ||
|
||||||
!isSelecting ||
|
!isSelecting ||
|
||||||
event.button !== 0 ||
|
event.button !== 0 ||
|
||||||
!containerBounds ||
|
!containerBounds ||
|
||||||
isNoKeyEvent ||
|
isNoKeyEvent ||
|
||||||
|
!isSelectionActive ||
|
||||||
!event.isPrimary
|
!event.isPrimary
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user