@fileverse-dev/fortune-react 1.2.96-scroll → 1.2.96-scroll-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -63,6 +63,10 @@ export var useSmoothScroll = function useSmoothScroll(scrollContainerRef) {
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
function handleMouseDragScroll(containerEl, scrollHandler, getPixelScale) {
|
|
66
|
+
if (context.luckysheetCellUpdate.length > 0) {
|
|
67
|
+
stopAutoScroll();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
66
70
|
var isDragging = false;
|
|
67
71
|
var startY = 0;
|
|
68
72
|
var lastY = 0;
|
|
@@ -290,13 +294,16 @@ export var useSmoothScroll = function useSmoothScroll(scrollContainerRef) {
|
|
|
290
294
|
var unmountMobileScrollHandler = handleMobileScroll(scrollContainerEl, scrollHandler, function () {
|
|
291
295
|
return (window.devicePixelRatio || 1) * context.zoomRatio;
|
|
292
296
|
});
|
|
293
|
-
var unmountMouseDragHandler
|
|
294
|
-
|
|
295
|
-
|
|
297
|
+
var unmountMouseDragHandler;
|
|
298
|
+
if (context.luckysheetCellUpdate.length === 0) {
|
|
299
|
+
unmountMouseDragHandler = handleMouseDragScroll(scrollContainerEl, scrollHandler, function () {
|
|
300
|
+
return (window.devicePixelRatio || 1) * context.zoomRatio;
|
|
301
|
+
});
|
|
302
|
+
}
|
|
296
303
|
return function () {
|
|
297
304
|
unmountScrollHandler();
|
|
298
305
|
unmountMobileScrollHandler();
|
|
299
|
-
unmountMouseDragHandler();
|
|
306
|
+
unmountMouseDragHandler === null || unmountMouseDragHandler === void 0 ? void 0 : unmountMouseDragHandler();
|
|
300
307
|
};
|
|
301
308
|
}
|
|
302
309
|
useEffect(function () {
|
|
@@ -156,7 +156,9 @@ var InputBox = function InputBox() {
|
|
|
156
156
|
delete refs.globalCache.doNotFocus;
|
|
157
157
|
}
|
|
158
158
|
}, [context.luckysheetCellUpdate, context.luckysheetfile, context.currentSheetId, firstSelection]);
|
|
159
|
+
var previousLuckyCellUpdate = usePrevious(context.luckysheetCellUpdate);
|
|
159
160
|
useEffect(function () {
|
|
161
|
+
console.log("inputbox luckysheetCellUpdate changed", previousLuckyCellUpdate, context.luckysheetCellUpdate);
|
|
160
162
|
if (_.isEmpty(context.luckysheetCellUpdate)) {
|
|
161
163
|
if (inputRef.current) {
|
|
162
164
|
inputRef.current.innerHTML = "";
|
|
@@ -70,6 +70,10 @@ var useSmoothScroll = exports.useSmoothScroll = function useSmoothScroll(scrollC
|
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
function handleMouseDragScroll(containerEl, scrollHandler, getPixelScale) {
|
|
73
|
+
if (context.luckysheetCellUpdate.length > 0) {
|
|
74
|
+
stopAutoScroll();
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
73
77
|
var isDragging = false;
|
|
74
78
|
var startY = 0;
|
|
75
79
|
var lastY = 0;
|
|
@@ -297,13 +301,16 @@ var useSmoothScroll = exports.useSmoothScroll = function useSmoothScroll(scrollC
|
|
|
297
301
|
var unmountMobileScrollHandler = handleMobileScroll(scrollContainerEl, scrollHandler, function () {
|
|
298
302
|
return (window.devicePixelRatio || 1) * context.zoomRatio;
|
|
299
303
|
});
|
|
300
|
-
var unmountMouseDragHandler
|
|
301
|
-
|
|
302
|
-
|
|
304
|
+
var unmountMouseDragHandler;
|
|
305
|
+
if (context.luckysheetCellUpdate.length === 0) {
|
|
306
|
+
unmountMouseDragHandler = handleMouseDragScroll(scrollContainerEl, scrollHandler, function () {
|
|
307
|
+
return (window.devicePixelRatio || 1) * context.zoomRatio;
|
|
308
|
+
});
|
|
309
|
+
}
|
|
303
310
|
return function () {
|
|
304
311
|
unmountScrollHandler();
|
|
305
312
|
unmountMobileScrollHandler();
|
|
306
|
-
unmountMouseDragHandler();
|
|
313
|
+
unmountMouseDragHandler === null || unmountMouseDragHandler === void 0 ? void 0 : unmountMouseDragHandler();
|
|
307
314
|
};
|
|
308
315
|
}
|
|
309
316
|
(0, _react.useEffect)(function () {
|
|
@@ -165,7 +165,9 @@ var InputBox = function InputBox() {
|
|
|
165
165
|
delete refs.globalCache.doNotFocus;
|
|
166
166
|
}
|
|
167
167
|
}, [context.luckysheetCellUpdate, context.luckysheetfile, context.currentSheetId, firstSelection]);
|
|
168
|
+
var previousLuckyCellUpdate = (0, _usePrevious.default)(context.luckysheetCellUpdate);
|
|
168
169
|
(0, _react.useEffect)(function () {
|
|
170
|
+
console.log("inputbox luckysheetCellUpdate changed", previousLuckyCellUpdate, context.luckysheetCellUpdate);
|
|
169
171
|
if (_lodash.default.isEmpty(context.luckysheetCellUpdate)) {
|
|
170
172
|
if (inputRef.current) {
|
|
171
173
|
inputRef.current.innerHTML = "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/fortune-react",
|
|
3
|
-
"version": "1.2.96-scroll",
|
|
3
|
+
"version": "1.2.96-scroll-2",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"tsc": "tsc"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@fileverse-dev/fortune-core": "1.2.96-scroll",
|
|
19
|
+
"@fileverse-dev/fortune-core": "1.2.96-scroll-2",
|
|
20
20
|
"@fileverse/ui": "5.0.0",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|