@mpxjs/webpack-plugin 2.10.18-beta.4 → 2.10.18-beta.6
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.
- package/lib/platform/style/wx/index.js +1 -1
- package/lib/runtime/components/react/dist/mpx-picker-view-column/index.jsx +9 -0
- package/lib/runtime/components/react/dist/utils.jsx +1 -1
- package/lib/runtime/components/react/mpx-picker-view-column/index.tsx +10 -0
- package/lib/runtime/components/react/utils.tsx +1 -1
- package/package.json +1 -1
|
@@ -422,7 +422,7 @@ module.exports = function getSpec({ warn, error }) {
|
|
|
422
422
|
if (Array.isArray(value) || cssVariableExp.test(value)) return { prop, value }
|
|
423
423
|
const values = parseValues(value)
|
|
424
424
|
// Todo transform 排序不一致时,transform动画会闪烁,故这里同样的排序输出 transform
|
|
425
|
-
values.sort()
|
|
425
|
+
// values.sort()
|
|
426
426
|
const transform = []
|
|
427
427
|
values.forEach(item => {
|
|
428
428
|
const match = item.match(/([/\w]+)\((.+)\)/)
|
|
@@ -73,6 +73,15 @@ const _PickerViewColumn = forwardRef((props, ref) => {
|
|
|
73
73
|
clearTimerScrollTo();
|
|
74
74
|
};
|
|
75
75
|
}, []);
|
|
76
|
+
// `contentOffset` prop sets visual position but does not fire scroll events,
|
|
77
|
+
// so `offsetYShared` (from `useScrollViewOffset`) stays at 0 until the user scrolls.
|
|
78
|
+
// Directly sync it whenever `itemRawH` is established so wheel animation renders correctly.
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
if (!itemRawH || dragging.current || scrolling.current) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
offsetYShared.value = activeIndex.current * itemRawH;
|
|
84
|
+
}, [itemRawH]);
|
|
76
85
|
useEffect(() => {
|
|
77
86
|
if (!scrollViewRef.current ||
|
|
78
87
|
!itemRawH ||
|
|
@@ -285,7 +285,7 @@ export function parseValues(str, char = ' ') {
|
|
|
285
285
|
function parseTransform(transformStr) {
|
|
286
286
|
const values = parseValues(transformStr);
|
|
287
287
|
// Todo transform 排序不一致时,transform动画会闪烁,故这里同样的排序输出 transform
|
|
288
|
-
values.sort()
|
|
288
|
+
// values.sort()
|
|
289
289
|
const transform = [];
|
|
290
290
|
values.forEach(item => {
|
|
291
291
|
const match = item.match(/([/\w]+)\((.+)\)/);
|
|
@@ -136,6 +136,16 @@ const _PickerViewColumn = forwardRef<HandlerRef<ScrollView & View, ColumnProps>,
|
|
|
136
136
|
}
|
|
137
137
|
}, [])
|
|
138
138
|
|
|
139
|
+
// `contentOffset` prop sets visual position but does not fire scroll events,
|
|
140
|
+
// so `offsetYShared` (from `useScrollViewOffset`) stays at 0 until the user scrolls.
|
|
141
|
+
// Directly sync it whenever `itemRawH` is established so wheel animation renders correctly.
|
|
142
|
+
useEffect(() => {
|
|
143
|
+
if (!itemRawH || dragging.current || scrolling.current) {
|
|
144
|
+
return
|
|
145
|
+
}
|
|
146
|
+
offsetYShared.value = activeIndex.current * itemRawH
|
|
147
|
+
}, [itemRawH])
|
|
148
|
+
|
|
139
149
|
useEffect(() => {
|
|
140
150
|
if (
|
|
141
151
|
!scrollViewRef.current ||
|
|
@@ -335,7 +335,7 @@ export function parseValues (str: string, char = ' ') {
|
|
|
335
335
|
function parseTransform (transformStr: string) {
|
|
336
336
|
const values = parseValues(transformStr)
|
|
337
337
|
// Todo transform 排序不一致时,transform动画会闪烁,故这里同样的排序输出 transform
|
|
338
|
-
values.sort()
|
|
338
|
+
// values.sort()
|
|
339
339
|
const transform: { [propName: string]: string | number | number[] }[] = []
|
|
340
340
|
values.forEach(item => {
|
|
341
341
|
const match = item.match(/([/\w]+)\((.+)\)/)
|