跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[前端开发] 求助!React 实现虚拟键盘后如何更新 Input 值的问题 跪求大佬解惑

发表于

本来是做的 React 传统 pc 端 web 应用,但是业务需求有进工厂用触摸屏的操作,场景变成了套壳 webview,因此所有的输入框都会唤起原生的安卓键盘直接挡住大部分屏幕内容,领导和安卓人员沟通无果,提出禁用安卓键盘弹出,让我搞个页面上的虚拟键盘点击输入,目前使用的 react-simple-keyboard,现在的问题是我在顶层组件监听全局聚焦事件 document.addEventListener('focusin', handleFocus) 然后唤出虚拟键盘组件,通过 event.target.value 更新值,但是因为 React 在管理状态,没办法调用到 setState 或者说 Form.setFields,所以通过 target.value 改了值以后,下次触发 React 更新直接会把值重置,求解怎么更新状态呀!!!当然如果直接把键盘组件写到每个业务表单代码同级上下文就没这些问题,可是这么多页面这么多表单组件不可能一个个去绑定吧 求助!!

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.