如果Textfield在Android键盘下通过,则将自动移动到字符串的开头 我正在为Android开发一个ReactJ中的应用程序。 这是一个带有Waze或Maps之类的菜单的映射应用程序,您可以从应用程序的底部拖动。 菜单是用MUI的D ...

问题描述 投票:0回答:0
菜单是使用MUI的抽屉组件制成的。它包含textfields.
在Android设备上的应用程序中,我将菜单放在中间并在Textfield中写入。在Textfield中写作会激活Android虚拟键盘。

IF,在将重点放在文本字段上并因此显示虚拟键盘时,我将菜单拖到虚拟键盘下(因此迫使Textfield在键盘下)。 TextField光标返回到第一个位置,当用户继续写入时,在看到TextField时输入的字符是在输入的。 我已经在Internet上进行了广泛的搜索,但找不到有关此问题的任何信息。您知道是什么原因导致这种行为?如果是这样,当光标在Android键盘下通过时,我该如何解决光标的问题?

Edit1:

在logcat中,当菜单通过Android键盘下方时,我在OnTouchend函数上登录。在此功能触发之后,我有这些日志,我无法解释,尤其是最后一部分(我不放置所有日志,只有菜单的拖动):

1043 26236 I SystemUiVisibilityPolicyController: handleMessage: entry what = 101 22250 22250 I ViewRootImpl@618c139[MainActivity]: ViewPostIme pointer 1 22250 22250 I Capacitor/Console: File: https://localhost/assets/index-D5EJiJmQ.js - Line 5 - Msg: LOG onEndSwipeableTranslate of percentage menu opening => 0% 4123 4123 I HBD : c CACHEDIC Text might be changed by view 4123 4123 I HBD : bb ous - 6 , 6 , 0 , 0 , -1 , -1 4123 4493 I HBD : b getET , flag: 1 , start: 0 , end: 0 , length: 0 , composingLength: 0 , isKCC: false 4123 4123 I HBD : ak EBD cm f 1 1043 2584 V UserManagerService: dumpPackageWhitelistProblems(): using mode ENFORCE|IMPLICIT_WHITELIST 4123 4123 I HBD : ak EBD ssu f 1 4123 4123 I HBD : a container vis= false .... 4123 4123 I SurfaceControl: nativeRelease nativeObject s[514287658560] 4123 4123 I SurfaceControl: nativeRelease nativeObject e[514287658560] 4123 4123 I SurfaceControl: assignNativeObject: nativeObject = 0 Surface(name=null)/@0x858697b / android.view.SurfaceControl.readFromParcel:1117 android.view.IWindowSession$Stub$Proxy.relayout:1820 android.view.ViewRootImpl.relayoutWindow:9005 android.view.ViewRootImpl.performTraversals:3360 android.view.ViewRootImpl.doTraversal:2618 android.view.ViewRootImpl$TraversalRunnable.run:9971 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995 4123 4123 I ViewRootImpl@1e146fc[InputMethod]: Relayout returned: old=(0,48,1200,1920) new=(0,48,1200,1920) req=(1200,1872)0 dur=4 res=0x1 s={true 514567372800} ch=false fn=136 4123 4123 I HBD : CandidateExpandButtonFrame Init expand button state by global layout listener 4123 4123 I HBD : b [ComposingItem] updateConfig: true to false .... 1043 1171 I InputDispatcher: Delivering touch to (4123): action: 0x0, f=0x0, d=0, 'e7c7eaa', t=1 +(0,-48) 4123 4123 I ViewRootImpl@1e146fc[InputMethod]: ViewPostIme pointer 0 4123 4123 I HBD : c SoundAndVibrationKeyA 4123 4123 I HBD : a sound is off 4123 4123 I HBD : b vib is off 4123 4123 I HBD : a [PF_KL] OTE 0 2 4 1939885 .... 4123 4123 I ViewRootImpl@1e146fc[InputMethod]: ViewPostIme pointer 1 4123 4123 I HBD : c CharacterKeyA 4123 4123 I HBD : c IIFO[r:6f09fb6339] 4123 4123 I HBD : ak EBD key t 0 4123 4123 I HBD : ak EBD ssu f 1 4123 4123 I HBD : a [PF_KL] OTE 1 2 26 24913846 4123 4123 I HBD : b [ComposingItem] updateConfig: false to true 4123 4123 I HBD : a container vis= true .... 7409 7409 I ViewRootImpl@2a11c8a[MainActivity]: ViewPostIme pointer 1 7409 7409 D InputMethodManager: HSIFW - flag : 0 1039 7600 V InputMethodManagerService: Client requesting input be hidden 1039 7600 V InputMethodManagerService: Calling com.android.internal.view.IInputMethod$Stub$Proxy@30d286b.hideSoftInput(0, android.os.Binder@427508d, null) for reason: HIDE_SOFT_INPUT 1039 7600 V InputMethodManagerService: hideCurrentInputLocked : send MSG_HIDE_SOFT_INPUT 1039 7600 I ActivityManager: Changes in 10158 5 to 7, 7 to 0 Caller=com.android.server.am.OomAdjuster.updateOomAdjLockedInner:672 com.android.server.am.OomAdjuster.updateOomAdjLocked:416 com.android.server.am.ActivityManagerService.updateOomAdjLocked:21536 com.android.server.am.ActiveServices.unbindServiceLocked:2498 com.android.server.am.ActivityManagerService.unbindService:18137 android.app.ContextImpl.unbindService:1957 com.android.server.inputmethod.InputMethodManagerService.hideCurrentInputLocked:3990 7409 7409 D InputMethodManager: prepareNavigationBarInfo() DecorView@5250363[MainActivity] 7409 7409 D InputMethodManager: getNavigationBarColor() -855310 7409 7409 V InputMethodManager: Starting input: tba=com.xxx ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false 7409 7409 D InputMethodManager: startInputInner - Id : 0 7409 7409 I InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus 1039 2660 D SamsungIMMSHWKeyboard: isConnectedDexOnPC false 1039 2660 D InputMethodManagerService: isImeSwitcherDisabledPackage : false 1039 2670 D InputMethodManagerService: mSecureKeypadEnabled = false 1039 2670 D InputMethodManagerService: DESKTOP MODE! : 2 1039 2670 D InputMethodManagerService: NOT IN KNOX DESKTOP MODE! 1039 2670 V InputMethodManagerService: getDisplayIdOfInputMethodWindowToBeAdded : 0 1039 1039 D EdgeLightingManager: isCallingUserSupported : callingUserId=-1, mUserId=0, isDualAppId=false, isKnoxId=false 1039 1039 D EdgeLightingManager: hideForNotification : packageName = android 1039 2670 D InputMethodManagerService: checkDisplayOfStartInputAndUpdateKeyboard display Id 0last 0 1039 1039 D EdgeLightingPolicyManager:NotificationGroup: remove : sbn : StatusBarNotification(pkg=android user=UserHandle{-1} id=8 tag=null key=-1|android|8|null|1000: Notification(channel=VIRTUAL_KEYBOARD shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0x2 color=0x00000000 category=sys vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0)) 1039 2670 D InputTransport: Input channel constructed: 'ClientS', fd=598 1039 1039 D EdgeLightingPolicyManager.NotificationGroup: group key = 0|com.xxx|0|null|10253 ,value= summary : null , child : 1key = 0|com.xxx|0|null|10253 , value = NotificationData { tag= null } , } 1039 2670 D InputTransport: Input channel destroyed: 'ClientS', fd=598 1039 1039 D EdgeLightingManager: hideForNotification : isInteractive is true 5993 5993 I HBD : HoneyBoardService onFinishInputView finishingInput= false 1039 1039 I NotificationService: RuneStone mIsRuneStoneSupported = true, mIsRuneStoneEnabled = false 5993 5993 I HBD : a [UpdatePolicy] [post] a: 3 cl: 1441799 kit: [0/2] vt: 0 ir: 1 5993 5993 I HBD : a processFinishInputView 7409 7409 D InputTransport: Input channel constructed: 'ClientS', fd=206 5993 5993 I HBD : a ExtractedText is empty 7409 7409 D InputTransport: Input channel destroyed: 'ClientS', fd=212 5993 6149 I HBD : i [SKE_LM] learnInDynamicModel, false 5993 6149 I HBD : i [SKE_LM] learnInDynamicModel, false 7409 7409 D InsetsSourceConsumer: setRequestedVisible: visible=false, type=13, host=com.xxx/com.xxx.MainActivity, from=android.view.InsetsSourceConsumer.hide:236 android.view.ImeInsetsSourceConsumer.hide:101 android.view.InsetsController.hideDirectly:1430 android.view.InsetsController.controlAnimationUnchecked:1112 android.view.InsetsController.applyAnimation:1417 android.view.InsetsController.hide:984 android.view.ViewRootImpl$ViewRootHandler.handleMessage:6150 android.os.Handler.dispatchMessage:106 android.os.Looper.loop:246 android.app.ActivityThread.main:8595 5993 5993 I HBD : a ExtractedText is empty 5993 5993 I HBD : bb stopRunningTimers

其他信息:

我使用电容器6

I检查了,当菜单进入键盘下方时,菜单项,尤其是Textfield仍在安装。发生错误时不会触发文本场的onfocus和onblur方法。

在AndroidManifest.xml文件中,我测试了Android的不同组合:WindowsoftinputMode,未指定,pan,调整大小,但仍然存在该错误。

Edit2:

好奇心,我看了看Waze。 当我想在Waze输入中写入以指示位置时,可拖动的菜单变为不可拖延的页面。 这意味着我不能做我想做的事?还是它违反了UX规则(在您看不到的字段中写作),因此我们永远不应该遇到我面临的错误?

MUI(材料UI)与反应天然不兼容。它仅用于网络。您必须为UI找到其他解决方案。

android reactjs material-ui capacitor window-soft-input-mode
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.