Skip to content

Commit

Permalink
update selector area pos after append in start
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultJanBeyer committed Mar 5, 2023
1 parent 0f759ec commit 42791c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions DragSelect/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
6 changes: 5 additions & 1 deletion DragSelect/src/modules/SelectorArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ export default class SelectorArea {
})
}

start = () => this.applyElements('append')
start = () => {
this.applyElements('append')
this.updatePos()
}

/**
* Adding / Removing elements to document
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 42791c4

Please sign in to comment.