@mpxjs/webpack-plugin 2.10.14-beta.10 → 2.10.14-beta.12

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.
@@ -158,12 +158,12 @@ const Input = forwardRef((props, ref) => {
158
158
  if (!keyboardAvoid?.current) {
159
159
  setKeyboardAvoidContext();
160
160
  }
161
- if (bindfocus && keyboardAvoid?.current) {
161
+ if (keyboardAvoid?.current) {
162
162
  const focusAction = () => {
163
- bindfocus(getCustomEvent('focus', evt, {
163
+ bindfocus?.(getCustomEvent('focus', evt, {
164
164
  detail: {
165
165
  value: tmpValue.current || '',
166
- height: keyboardAvoid.current?.keyboardHeight,
166
+ height: keyboardAvoid.current?.keyboardHeight
167
167
  },
168
168
  layoutRef
169
169
  }, props));
@@ -32,7 +32,9 @@ const KeyboardAvoidingView = ({ children, style, contentContainerStyle }) => {
32
32
  // 修复 Android 点击键盘收起按钮时当前 input 没触发失焦的问题
33
33
  inputRef.blur();
34
34
  }
35
- keyboardAvoid.current = null;
35
+ if (!keyboardAvoid.current.onKeyboardShow) {
36
+ keyboardAvoid.current = null;
37
+ }
36
38
  }
37
39
  cancelAnimation(offset);
38
40
  offset.value = withTiming(0, { duration, easing });
@@ -203,7 +203,7 @@ function backgroundSize(imageProps, preImageInfo, imageSize, layoutInfo) {
203
203
  else { // 数值类型 ImageStyle
204
204
  // 数值类型设置为 stretch
205
205
  imageProps.resizeMode = 'stretch';
206
- if (type === 'linear' && (!layoutWidth || !layoutHeight)) {
206
+ if (type === 'linear' && (!layoutWidth || !layoutHeight) && isNeedLayout(preImageInfo)) {
207
207
  // ios 上 linear 组件只要重新触发渲染,在渲染过程中外层容器 width 或者 height 被设置为 0,通过设置 % 的方式会渲染不出来,即使后面再更新为正常宽高也渲染不出来
208
208
  // 所以 hack 手动先将 linear 宽高也设置为 0,后面再更新为正确的数值或 %。
209
209
  dimensions = {
@@ -212,6 +212,7 @@ function backgroundSize(imageProps, preImageInfo, imageSize, layoutInfo) {
212
212
  };
213
213
  }
214
214
  else {
215
+ // background-size 手动设置具体值,不会触发 onLayout,需要走这里的逻辑
215
216
  dimensions = {
216
217
  width: isPercent(width) ? width : +width,
217
218
  height: isPercent(height) ? height : +height
@@ -301,16 +301,16 @@ const Input = forwardRef<HandlerRef<TextInput, FinalInputProps>, FinalInputProps
301
301
  setKeyboardAvoidContext()
302
302
  }
303
303
 
304
- if (bindfocus && keyboardAvoid?.current) {
304
+ if (keyboardAvoid?.current) {
305
305
  const focusAction = () => {
306
- bindfocus(
306
+ bindfocus?.(
307
307
  getCustomEvent(
308
308
  'focus',
309
309
  evt,
310
310
  {
311
311
  detail: {
312
312
  value: tmpValue.current || '',
313
- height: keyboardAvoid.current?.keyboardHeight,
313
+ height: keyboardAvoid.current?.keyboardHeight
314
314
  },
315
315
  layoutRef
316
316
  },
@@ -45,7 +45,9 @@ const KeyboardAvoidingView = ({ children, style, contentContainerStyle }: Keyboa
45
45
  // 修复 Android 点击键盘收起按钮时当前 input 没触发失焦的问题
46
46
  inputRef.blur()
47
47
  }
48
- keyboardAvoid.current = null
48
+ if (!keyboardAvoid.current.onKeyboardShow) {
49
+ keyboardAvoid.current = null
50
+ }
49
51
  }
50
52
 
51
53
  cancelAnimation(offset)
@@ -287,7 +287,7 @@ function backgroundSize (imageProps: ImageProps, preImageInfo: PreImageInfo, ima
287
287
  } else { // 数值类型 ImageStyle
288
288
  // 数值类型设置为 stretch
289
289
  imageProps.resizeMode = 'stretch'
290
- if (type === 'linear' && (!layoutWidth || !layoutHeight)) {
290
+ if (type === 'linear' && (!layoutWidth || !layoutHeight) && isNeedLayout(preImageInfo)) {
291
291
  // ios 上 linear 组件只要重新触发渲染,在渲染过程中外层容器 width 或者 height 被设置为 0,通过设置 % 的方式会渲染不出来,即使后面再更新为正常宽高也渲染不出来
292
292
  // 所以 hack 手动先将 linear 宽高也设置为 0,后面再更新为正确的数值或 %。
293
293
  dimensions = {
@@ -295,6 +295,7 @@ function backgroundSize (imageProps: ImageProps, preImageInfo: PreImageInfo, ima
295
295
  height: 0
296
296
  } as { width: NumberVal, height: NumberVal }
297
297
  } else {
298
+ // background-size 手动设置具体值,不会触发 onLayout,需要走这里的逻辑
298
299
  dimensions = {
299
300
  width: isPercent(width) ? width : +width,
300
301
  height: isPercent(height) ? height : +height
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.10.14-beta.10",
3
+ "version": "2.10.14-beta.12",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"