Skip to content

Commit

Permalink
fix(draggable): able to move scrolled pane by draggable element (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-rr committed Jun 18, 2023
1 parent e9369ce commit 9e3eaaa
Show file tree
Hide file tree
Showing 18 changed files with 59 additions and 29 deletions.
4 changes: 2 additions & 2 deletions dist/core/index.js

Large diffs are not rendered by default.

15 changes: 12 additions & 3 deletions dist/cupertino-pane.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* Released under the MIT License
*
* Released on: June 17, 2023
* Released on: June 18, 2023
*/

/******************************************************************************
Expand Down Expand Up @@ -354,8 +354,11 @@ class Events {
if (t.type === 'mousedown')
this.mouseDown = true;
// if overflow content was scrolled
// and drag not by draggable
// increase to scrolled value
if (this.contentScrollTop && this.willScrolled()) {
if (this.contentScrollTop
&& this.willScrolled()
&& !this.isDraggableElement(t)) {
this.startY += this.contentScrollTop;
}
this.steps.push({ posY: this.startY, posX: this.startX, time: Date.now() });
Expand Down Expand Up @@ -447,7 +450,8 @@ class Events {
// Not allow move panel with positive overflow scroll
// Scroll handler
if (this.instance.overflowEl.style.overflowY === 'auto'
&& this.scrollPreventDrag(t)) {
&& this.scrollPreventDrag(t)
&& !this.isDraggableElement(t)) {
return;
}
// Topper-top/Lower-bottom recognizers
Expand Down Expand Up @@ -781,6 +785,7 @@ class Events {
}
return true;
}
// TODO: switch to contains
isPaneDescendant(el) {
if (!el) {
return false;
Expand All @@ -794,6 +799,10 @@ class Events {
}
return false;
}
isDraggableElement(t) {
return t.target === this.instance.draggableEl
|| t.target === this.instance.moveEl;
}
isFormElement(el) {
const formElements = [
'input', 'select', 'option',
Expand Down
4 changes: 2 additions & 2 deletions dist/cupertino-pane.esm.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cupertino-pane.esm.min.js.map

Large diffs are not rendered by default.

15 changes: 12 additions & 3 deletions dist/cupertino-pane.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cupertino-pane.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/cupertino-pane.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modules/backdrop.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/modules/fit-height.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/modules/follower.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9e3eaaa

Please sign in to comment.