ios26 uni-app textarea 设置 show-confirm-bar="false" 导致键盘遮挡输入框

ios26 uni-app textarea 设置 show-confirm-bar=“false” 导致键盘遮挡输入框

开发环境 版本号 项目创建方式
Mac mac15.5 HBuilderX
## 示例代码:

```html
<template>  
    <view class="pageV">  
        <view class="pageV_top"></view>  
        <view class="pageV_middle"></view>  
        <view class="pageV_bottom">  
            <textarea class="pageV_bottom_input" value="ccdxd" :show-confirm-bar="false"></textarea>  
        </view>  
    </view>  
</template>  
<script lang="ts" setup></script>  
<style lang="scss" scoped>  
.pageV {  
    height: 100%;  
    display: flex;  
    flex-direction: column;  
    &_top {  
        height: 100rpx;  
        background-color: yellow;  
    }  
    &_middle {  
        flex: 1;  
        overflow: hidden;  
        min-height: 0px;  
        background-color: green;  
    }  
    &_bottom {  
        background-color: red;  
        &_input {  
            width: 100%;  
            height: 120rpx;  
        }  
    }  
}  
</style>  

操作步骤:

hbuilderx 创建 一个 vue3的项目, 使用 提供的 简单 代码 , 运行到 ios26的真机上

预期结果:

键盘不遮挡

实际结果:

键盘发生了遮挡, 页面没有弹起来

bug描述:

使用下方的 代码 点击 textarea
在 ios26的 真机中, 键盘发生了 遮挡, 盖住了 输入框 在 ios 18.4.1的真机中, 键盘弹起, 页面正常弹起


更多关于ios26 uni-app textarea 设置 show-confirm-bar="false" 导致键盘遮挡输入框的实战教程也可以访问 https://www.itying.com/category-93-b0.html

5 回复

我这边也出现了

更多关于ios26 uni-app textarea 设置 show-confirm-bar="false" 导致键盘遮挡输入框的实战教程也可以访问 https://www.itying.com/category-93-b0.html


相同代码跑在其他 ios版本系统上是否正常,是 ios26 有问题还是都有问题

相同代码跑在其他 ios版本系统上是否正常,是 ios26 有问题还是都有问题

只有 ios26 有问题, 我测试的 ios 18.4.1 没有问题

这是一个已知的 iOS 26 系统兼容性问题。当 textarea 组件设置 show-confirm-bar="false" 时,系统键盘的确认栏被隐藏,导致 iOS 26 的键盘弹起机制出现异常,无法正确触发页面滚动。

临时解决方案:

  1. 移除 show-confirm-bar="false" 属性,保留默认的确认栏
  2. 使用 @focus 事件手动控制页面滚动:
<textarea 
  @focus="handleFocus"
  :adjust-position="false"
></textarea>
const handleFocus = () => {
  setTimeout(() => {
    const query = uni.createSelectorQuery()
    query.select('.pageV_bottom').boundingClientRect()
    query.exec((res) => {
      if (res[0]) {
        uni.pageScrollTo({
          scrollTop: res[0].top,
          duration: 300
        })
      }
    })
  }, 100)
}
回到顶部