Skip to content

Commit 5d1c342

Browse files
committed
fix: embedded mode not resizable on mobile
1 parent e83b708 commit 5d1c342

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"devDependencies": {
4343
"@eslint/js": "^9.5.0",
4444
"@types/eslint__js": "^8.42.3",
45-
"chobitsu": "^1.8.3",
45+
"chobitsu": "^1.8.4",
4646
"css-loader": "^6.7.2",
4747
"es-check": "^6.2.1",
4848
"eslint": "^8.57.0",
@@ -72,7 +72,7 @@
7272
"koa-compress": "^4.0.1",
7373
"koa-router": "^13.0.1",
7474
"koa-send": "^5.0.0",
75-
"licia": "^1.42.0",
75+
"licia": "^1.43.0",
7676
"ws": "^8.18.0"
7777
}
7878
}

src/target/DevtoolsFrame.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import isJson from 'licia/isJson';
1010
import contain from 'licia/contain';
1111
import uniqId from 'licia/uniqId';
1212
import nextTick from 'licia/nextTick';
13+
import pointerEvent from 'licia/pointerEvent';
1314
import { getOrigin } from './util';
1415

1516
const $document = $(document as any);
@@ -169,7 +170,7 @@ export default class DevtoolsFrame {
169170
}
170171
private bindEvent() {
171172
window.addEventListener('resize', this.resize);
172-
this.$draggable.on('mousedown', this.onResizeStart);
173+
this.$draggable.on(pointerEvent('down'), this.onResizeStart);
173174
}
174175
private onResizeStart = (e: any) => {
175176
e.stopPropagation();
@@ -180,10 +181,12 @@ export default class DevtoolsFrame {
180181
this.$draggable.css({
181182
height: '100%',
182183
});
183-
$document.on('mousemove', this.onResizeMove);
184-
$document.on('mouseup', this.onResizeEnd);
184+
$document.on(pointerEvent('move'), this.onResizeMove);
185+
$document.on(pointerEvent('up'), this.onResizeEnd);
185186
};
186187
private onResizeMove = (e: any) => {
188+
e.stopPropagation();
189+
e.preventDefault();
187190
const deltaY = e.origEvent.clientY - this.startY;
188191
this.setHeight(this.originHeight - deltaY);
189192
this.resize();
@@ -192,8 +195,8 @@ export default class DevtoolsFrame {
192195
this.$draggable.css({
193196
height: 10,
194197
});
195-
$document.off('mousemove', this.onResizeMove);
196-
$document.off('mouseup', this.onResizeEnd);
198+
$document.off(pointerEvent('move'), this.onResizeMove);
199+
$document.off(pointerEvent('up'), this.onResizeEnd);
197200
};
198201
private resize = () => {
199202
let { height } = this;

0 commit comments

Comments
 (0)