# 微信小程序输入框上移问题
- 缺陷:输入框顶起整个页面 包括自定义顶栏
- 解决方式:给input设置adjust-position="false"后自定义input高度
- wxml
<view class="submit" style="bottom:{{bottom}}px">
<view class="serch-view">
<input bindconfirm="toSubmit"
value="{{code}}"
bindfocus="inputFocus"
bindblur="inputBlur"
adjust-position="{{false}}"
class="block-main"
type="text"
confirm-type="go"
cursor-spacing="100" class="course-search"></input>
<view bindtap="search" class="search-button">发 送</view>
</view>
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
- js
inputFocus (e) {
console.log(e);
this.setData({bottom: e.detail.height})
},
inputBlur () {
this.setData({bottom: 0})
},
1
2
3
4
5
6
7
2
3
4
5
6
7