会出现这个问题,一般是受到了滚动条的影响,所以,在获取焦点时,需要关闭页面滚动,失去焦点时,就开启滚动,例如页面里存在scroll-view组件
示例代码
wxml片段
<scroll-view class="m_scroll" style="height:100vh;" scroll-y="{{aFocus}}" scroll-with-animation> </scroll-view> <input type="text" class="i_l_input" placeholder="" bindfocus="handleFocus" bindblur="handleBlur" adjust-position="{{false}}" maxlength="120" />
js片段
data: { aFocus: true }, handleFocus(e){ this.setData({ aFocus:false }) }, handleBlur(){ this.setData({ aFocus:true }) },
标签:aFocus,微信,输入框,true,光标,setData From: https://www.cnblogs.com/murenziwei/p/17463533.html