From 42791c42e9412273fa3239bddee69632340672da Mon Sep 17 00:00:00 2001 From: Thibault Jan Beyer Date: Sun, 5 Mar 2023 14:05:29 +0100 Subject: [PATCH] update selector area pos after append in start --- DragSelect/CHANGELOG.md | 5 +++++ DragSelect/src/modules/SelectorArea.js | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/DragSelect/CHANGELOG.md b/DragSelect/CHANGELOG.md index 1304ae87..fd739cd9 100644 --- a/DragSelect/CHANGELOG.md +++ b/DragSelect/CHANGELOG.md @@ -1,3 +1,8 @@ +# 2.7.2 + +- Add readme to npmjs +- Fix bug [#170](https://github.com/ThibaultJanBeyer/DragSelect/issues/170) where area position was not updated after a start when the area was the document itself and there was a timeout. + # 2.7.0 - Introduce blog-drag as alpha. It is supposed to fix dragging of multiple elements: dragging them as one block keeping aspect ratio positions on drag-scroll. Instead of moving elements individually. This was considered a bug. However as it is not fully tested it comes under a flag, please turn it on by setting `dragAsBlock: true` and [report any issue you find here](https://github.com/ThibaultJanBeyer/DragSelect/issues). Thanks to [@rendertom](https://github.com/rendertom) for the addition [#162](https://github.com/ThibaultJanBeyer/DragSelect/pull/162). diff --git a/DragSelect/src/modules/SelectorArea.js b/DragSelect/src/modules/SelectorArea.js index 399255f5..ef5d78db 100644 --- a/DragSelect/src/modules/SelectorArea.js +++ b/DragSelect/src/modules/SelectorArea.js @@ -52,7 +52,10 @@ export default class SelectorArea { }) } - start = () => this.applyElements('append') + start = () => { + this.applyElements('append') + this.updatePos() + } /** * Adding / Removing elements to document @@ -153,6 +156,7 @@ export default class SelectorArea { ? PointerStore.getPointerPosition(event) : PointerStore.initialVal + console.log('isClicked', initialVal, this.rect, this.HTMLNode); return isCollision( { left: initialVal.x,