Fix dragging of bottom sheet

This commit is contained in:
N-Pex 2022-04-26 13:53:46 +02:00
parent abfb446d90
commit 80e5482d9a

View file

@ -48,6 +48,7 @@ export default {
mc: null,
y: 0,
startY: 0,
startYCoord: 0,
isMove: false,
state: this.defaultState,
rect: {},
@ -65,14 +66,20 @@ export default {
const self = this;
this.mc.on("panup pandown", (evt) => {
self.y = evt.center.y - 16;
self.y = self.startYCoord - (self.startY - evt.center.y);
});
this.mc.on("panstart", (evt) => {
self.startY = evt.center.y;
self.startYCoord = this.calcY();
self.isMove = true;
});
this.mc.on("pancancel", (ignoredEvt) => {
self.y = self.startYCoord;
self.isMove = false;
});
this.mc.on("panend", (evt) => {
self.isMove = false;