Skip to content

fix(swan): support hold-keyboard for input fields - #19494

Merged
Single-Dancer merged 1 commit into
NervJS:mainfrom
dvd233:fix/swan-hold-keyboard-support
Sep 22, 2026
Merged

Single-Dancer merged 1 commit into
NervJS:mainfrom
dvd233:fix/swan-hold-keyboard-support

Conversation

@dvd233

@dvd233 dvd233 commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

这个 PR 做了什么? (简要描述所做更改)

Fixes #15572.

百度智能小程序的 input 和 textarea 已支持 hold-keyboard。本 PR:

  • 为 InputProps.holdKeyboard 与 TextareaProps.holdKeyboard 补充 swan 平台标注;
  • 在百度小程序平台模板属性表中为两个组件透传 hold-keyboard;
  • 保持官方默认值 false,不改变未传入该属性时的行为。

官方文档:

验证

  • corepack pnpm lint
  • corepack pnpm --filter @tarojs/plugin-platform-swan run build
  • corepack pnpm --filter @tarojs/components run build:ci
  • 模板红绿对照:修复前 Input/Textarea 均不生成 hold-keyboard;修复后均生成该属性并保留 false 默认值
  • @tarojs/components spec:70 suites / 106 tests / 35 snapshots 全部通过

这个 PR 是什么类型? (至少选择一个)

这个 PR 涉及以下平台:

  • 所有平台
  • Web 端(H5)
  • 移动端(React-Native)
  • 鸿蒙(Harmony)
  • 鸿蒙容器(Harmony Hybrid)
  • ASCF 元服务
  • 快应用(QuickApp)
  • 所有小程序
  • 微信小程序
  • 企业微信小程序
  • 京东小程序
  • 百度小程序
  • 支付宝小程序
  • 支付宝 IOT 小程序
  • 钉钉小程序
  • QQ 小程序
  • 飞书小程序
  • 快手小程序
  • 头条小程序

Summary by CodeRabbit

  • 新功能
    • 百度小程序平台的 Input 和 Textarea 组件新增 hold-keyboard 属性支持。
    • 更新组件文档,标明该属性适用于百度小程序平台。

@coderabbitai

coderabbitai Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 7e098b4a-3414-4cd0-9530-14ed58696bbe

📥 Commits

Reviewing files that changed from the base of the PR and between d6d69e3 and 78d5e7a.

📒 Files selected for processing (3)
  • packages/taro-components/types/Input.d.ts
  • packages/taro-components/types/Textarea.d.ts
  • packages/taro-platform-swan/src/components.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


Walkthrough

本次变更为百度小程序的 holdKeyboard 增加支持声明,并为 Input 与 Textarea 配置 hold-keyboard: 'false' 默认值。未修改运行时逻辑。

Changes

百度小程序表单组件支持

Layer / File(s) Summary
同步支持声明与组件配置
packages/taro-components/types/Input.d.ts, packages/taro-components/types/Textarea.d.ts, packages/taro-platform-swan/src/components.ts
Input 与 Textarea 的 holdKeyboard 注释新增 swan 平台。百度小程序组件配置新增 hold-keyboard: 'false'。

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to 78d5e

This change enables the existing hold-keyboard option for Swan input and textarea fields while preserving current behavior when it is omitted; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题明确描述了本次变更:为 Swan 平台的 Input 字段支持 hold-keyboard。内容与主要代码变更一致,简洁且具体。
Linked Issues check ✅ Passed 变更满足 issue #15572 的主要目标。PR 为 Swan 平台的 Input 和 Textarea 增加 hold-keyboard 配置,补充对应 API 支持声明,并保留默认值 false,覆盖表单提交后保持键盘的使用场景。
Out of Scope Changes check ✅ Passed 所有变更均与 issue #15572 直接相关。类型注释更新和 Swan 组件配置更新没有引入无关功能或范围外修改。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3 files.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

小兔带着键盘跑,
holdKeyboard 旗子飘。
Input、Textarea 并肩站,
swan 配置已报到。
默认 false,代码轻轻笑。

Comment @coderabbitai help to get the list of available commands.

@Single-Dancer
Single-Dancer self-requested a review September 20, 2026 13:06
@codecov

codecov Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.63%. Comparing base (2dc2036) to head (35fbcfd).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #19494   +/-   ##
=======================================
  Coverage   54.63%   54.63%           
=======================================
  Files         464      464           
  Lines       25391    25391           
  Branches     6354     6346    -8     
=======================================
  Hits        13872    13872           
+ Misses       9641     9638    -3     
- Partials     1878     1881    +3     
Flag Coverage Δ
taro-cli 56.96% <ø> (ø)
taro-runtime 57.88% <ø> (ø)
taro-web 52.37% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Single-Dancer
Single-Dancer force-pushed the fix/swan-hold-keyboard-support branch from 78d5e7a to 35fbcfd Compare September 22, 2026 03:14
@Single-Dancer
Single-Dancer merged commit 6205652 into NervJS:main Sep 22, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

百度小程序的input组件已经支持了hold- keyboard,什么时候统一一下呢

2 participants