首页 > 解决方案 > 反应键盘景观

问题描述

我的反应有问题。我有一个带有一些表单和输入字段的网络应用程序。当我在纵向模式下单击并使用 PC、智能手机或平板电脑的键盘输入字段时,一切正常,但是当我更改设备的方向并单击一个字段时,键盘会出现,但它会覆盖所有视图。我怎么解决这个问题?

我的搜索组件表单示例:

 <div className="vv-search-form-layout">
  <div className="d-flex flex-row search-form">
    <input
      type='text'
      name="search"
      value={searchValue}
      className="form-control search-text"
      onChange={changeSearch}
      onKeyPress={onKeyPress}
      ref={this.searchInput}
     />
   </div>
  </div>

CSS:

.vv-search-form-layout {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
 
  @media (min-width: $md) {
    margin-bottom: 0;
  }
}

.search-form {
  text-align: center;
  justify-content: center;
  align-items: center;
  max-width: 35rem;
  width: 100%;
}

标签: reactjsinputkeyboardlandscape

解决方案


推荐阅读