You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the deps array passed to useHeight contains an input box, it could cause re-renders whenever the input value changes. This can lead to focus loss if the component re-renders while typing.
To mitigate this issue, you can try the following:
Ensure that the deps array only includes dependencies that are necessary for height calculation.
Avoid including the input box or its state directly in the deps array if possible.
The text was updated successfully, but these errors were encountered:
问题出在哪个包
@taroify/core
问题出在哪个平台/设备/浏览器
H5
平台/设备/浏览器
No response
你正在使用的 Taroify 版本是多少
0.6.3-alpha.0
描述一下您遇到的问题以及重现步骤
Code:
repro steps:
console中输出警告
如果可能的话,请包含一个代码框的链接与复制的问题
No response
你知道如何解决这个问题吗
None
您是否愿意参与修复这个问题,并创建一个 PR
None
修复这个问题的解决方案
前端小白做了一些调研:
问题可能在
use-height.ts
use-placeholder.tsx
个人理解是render过程中对一些控件计算高度,引起了新的状态变化,再次触发更新,非 Input 的控件可能不受影响,input控件会导致焦点变化(下面附copilot的分析)。
可能的修复: 将placeholder从包含FixedView children改成并列放在children下方render,然后设置z-index使之隐藏在children后面,这样是否能避免input的多次render,维持焦点。
Github copilot:
The text was updated successfully, but these errors were encountered: