l***@sina.com
l***@sina.com
  • 发布:2018-05-26 15:33
  • 更新:2018-05-26 15:34
  • 阅读:1509

滚动 input 输入法 遮挡 输入框问题

分类:MUI

<div class="mui-content">
<div class="mui-scroll-wrapper">
<div class="mui-scroll">
<div class="mui-content-padded">
<form id="fm_material_affirm" class="mui-input-group">
<div class="mui-table">
<div class="mui-row">
<div class="mui-table-cell mui-col-sm-12 mui-col-xs-12">
<div class="mui-input-row">
<input type="text" placeholder="1" class="mui-register"/>
</div>
</div>
</div>
<div class="mui-row">
<div class="mui-table-cell mui-col-sm-12 mui-col-xs-12">
<div class="mui-input-row">
<input type="text" placeholder="2" class="mui-stylist"/>
</div>
</div>
</div>
<div class="mui-row">
<div class="mui-table-cell mui-col-sm-12 mui-col-xs-12">
<div class="mui-input-row">
<input type="text" placeholder="3" class="mui-stylist"/>
</div>
</div>
</div>
<div class="mui-row">
<div class="mui-table-cell mui-col-sm-12 mui-col-xs-12">
<div class="mui-input-row">

                                </div>  
                            </div>  
                        </div>  
                    </div>  
                </form>  
            </div>  
        </div>  
    </div>  
</div>  

js :

mui.init();
var deceleration = mui.os.ios?0.003:0.0009;
mui('.mui-scroll-wrapper').scroll({
bounce: false,
indicators: true, //是否显示滚动条,
deceleration:deceleration
});

document.addEventListener("focusin",function(e){
var target = e.target;
if (target.tagName && (target.tagName === 'TEXTAREA' || (target.tagName === 'INPUT' && (target.type === 'text' || target.type === 'search' || target.type === 'number'))))
{
setTimeout(function(){
target.scrollIntoView(true);
},200);
}
});
问题:

target.scrollIntoView(false);使用这个后,输入框聚焦后都能在可视区显示,有一个问题就是:输入框可视后,聚焦的输入框所在的<div class="mui-scroll-wrapper">滚动条不能下拉查看,聚焦输入框上面不可视的数据,是怎么回事呢,各位大侠!具体代码查看附件

2018-05-26 15:33 负责人:无 分享
已邀请:
l***@sina.com

l***@sina.com (作者)

target.scrollIntoView(true); 后边添加:mui('.mui-scroll-wrapper').scroll().refresh(); 也不起作用

该问题目前已经被锁定, 无法添加新回复