fix: mouse event on touch device
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
|
||||
.BundleAnalyzerPlugin
|
||||
const BundleAnalyzerPlugin =
|
||||
require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
||||
|
||||
exports = require('./webpack.prod')
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
"licia": "^1.38.2",
|
||||
"luna-box-model": "^0.1.0",
|
||||
"luna-console": "^1.3.3",
|
||||
"luna-data-grid": "^0.4.3",
|
||||
"luna-data-grid": "^0.5.1",
|
||||
"luna-dom-viewer": "^1.2.3",
|
||||
"luna-modal": "^1.0.0",
|
||||
"luna-notification": "^0.1.4",
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
.resizer {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
touch-action: none;
|
||||
left: 0;
|
||||
top: -8px;
|
||||
cursor: row-resize;
|
||||
|
||||
@@ -151,6 +151,7 @@ function processClass(str) {
|
||||
}
|
||||
|
||||
const hasTouchSupport = 'ontouchstart' in root
|
||||
const hasPointerSupport = 'PointerEvent' in root
|
||||
const touchEvents = {
|
||||
start: 'touchstart',
|
||||
move: 'touchmove',
|
||||
@@ -161,8 +162,17 @@ const mouseEvents = {
|
||||
move: 'mousemove',
|
||||
end: 'mouseup',
|
||||
}
|
||||
const pointerEvents = {
|
||||
start: 'pointerdown',
|
||||
move: 'pointermove',
|
||||
end: 'pointerup',
|
||||
}
|
||||
|
||||
export function drag(name) {
|
||||
if (hasPointerSupport) {
|
||||
return pointerEvents[name]
|
||||
}
|
||||
|
||||
return hasTouchSupport ? touchEvents[name] : mouseEvents[name]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user