@mpxjs/webpack-plugin 2.10.18-beta.6 → 2.10.18-beta.7

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.
@@ -40,7 +40,7 @@
40
40
  import { forwardRef, useRef, useState, useContext, useEffect, createElement } from 'react';
41
41
  import { TextInput } from 'react-native';
42
42
  import { warn } from '@mpxjs/utils';
43
- import { useUpdateEffect, useTransformStyle, useLayout, extendObject, isAndroid } from './utils';
43
+ import { useUpdateEffect, useTransformStyle, useLayout, extendObject } from './utils';
44
44
  import useInnerProps, { getCustomEvent } from './getInnerListeners';
45
45
  import useNodesRef from './useNodesRef';
46
46
  import { FormContext, KeyboardAvoidContext } from './context';
@@ -285,11 +285,6 @@ const Input = forwardRef((props, ref) => {
285
285
  ? nodeRef.current?.focus()
286
286
  : nodeRef.current?.blur();
287
287
  }, [isAutoFocus]);
288
- // 使用 multiline 来修复光标位置问题
289
- // React Native 的 TextInput 在 textAlign center + placeholder 时光标会跑到右边
290
- // 这个问题只在 Android 上出现
291
- // 参考:https://github.com/facebook/react-native/issues/28794 (Android only)
292
- const needMultilineFix = isAndroid && !multiline;
293
288
  const innerProps = useInnerProps(extendObject({}, props, layoutProps, {
294
289
  ref: nodeRef,
295
290
  style: extendObject({}, normalStyle, layoutStyle),
@@ -308,7 +303,7 @@ const Input = forwardRef((props, ref) => {
308
303
  underlineColorAndroid: 'rgba(0,0,0,0)',
309
304
  textAlignVertical: textAlignVertical,
310
305
  placeholderTextColor: placeholderStyle?.color,
311
- multiline: multiline || needMultilineFix,
306
+ multiline: !!multiline,
312
307
  onTouchStart,
313
308
  onTouchEnd,
314
309
  onFocus,
@@ -317,7 +312,7 @@ const Input = forwardRef((props, ref) => {
317
312
  onSelectionChange,
318
313
  onContentSizeChange,
319
314
  onSubmitEditing: bindconfirm && onSubmitEditing
320
- }, needMultilineFix ? { numberOfLines: 1 } : {}, !!multiline && confirmType === 'return' ? {} : { enterKeyHint: confirmType }), [
315
+ }, !!multiline && confirmType === 'return' ? {} : { enterKeyHint: confirmType }), [
321
316
  'type',
322
317
  'password',
323
318
  'placeholder-style',
@@ -54,7 +54,7 @@ import {
54
54
  NativeTouchEvent
55
55
  } from 'react-native'
56
56
  import { warn } from '@mpxjs/utils'
57
- import { useUpdateEffect, useTransformStyle, useLayout, extendObject, isAndroid } from './utils'
57
+ import { useUpdateEffect, useTransformStyle, useLayout, extendObject, isIOS } from './utils'
58
58
  import useInnerProps, { getCustomEvent } from './getInnerListeners'
59
59
  import useNodesRef, { HandlerRef } from './useNodesRef'
60
60
  import { FormContext, FormFieldValue, KeyboardAvoidContext } from './context'
@@ -472,12 +472,6 @@ const Input = forwardRef<HandlerRef<TextInput, FinalInputProps>, FinalInputProps
472
472
  : (nodeRef.current as TextInput)?.blur()
473
473
  }, [isAutoFocus])
474
474
 
475
- // 使用 multiline 来修复光标位置问题
476
- // React Native 的 TextInput 在 textAlign center + placeholder 时光标会跑到右边
477
- // 这个问题只在 Android 上出现
478
- // 参考:https://github.com/facebook/react-native/issues/28794 (Android only)
479
- const needMultilineFix = isAndroid && !multiline
480
-
481
475
  const innerProps = useInnerProps(
482
476
  extendObject(
483
477
  {},
@@ -501,7 +495,7 @@ const Input = forwardRef<HandlerRef<TextInput, FinalInputProps>, FinalInputProps
501
495
  underlineColorAndroid: 'rgba(0,0,0,0)',
502
496
  textAlignVertical: textAlignVertical,
503
497
  placeholderTextColor: placeholderStyle?.color,
504
- multiline: multiline || needMultilineFix,
498
+ multiline: !!multiline,
505
499
  onTouchStart,
506
500
  onTouchEnd,
507
501
  onFocus,
@@ -511,7 +505,6 @@ const Input = forwardRef<HandlerRef<TextInput, FinalInputProps>, FinalInputProps
511
505
  onContentSizeChange,
512
506
  onSubmitEditing: bindconfirm && onSubmitEditing
513
507
  },
514
- needMultilineFix ? { numberOfLines: 1 } : {},
515
508
  !!multiline && confirmType === 'return' ? {} : { enterKeyHint: confirmType }
516
509
  ),
517
510
  [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.10.18-beta.6",
3
+ "version": "2.10.18-beta.7",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"