Repository navigation
Conversation
lnuxe
requested review from
anlyyao,
betavs,
jarmywang,
jin0209,
novlan1 and
zydemail
as code owners
November 16, 2026 09:41
calcMonths returned early for switchMode 'none' after setting months only, so currentMonth stayed at its initial empty object. Opening the panel could not locate the selected range whenever minDate/maxDate spanned a long period. Derive currentMonth in that branch too, keeping the existing behaviour of not touching the month switch buttons. fix Tencent#4718
Review feedback: keep one unit test file per component instead of adding a new file per scenario. The scrollIntoView case now lives in index.test.js under its own describe block, and scroll-into-view.test.js is gone. No behaviour change.
The popup enter animation keeps the dialog container inside a scale/translate composited layer. Native input placeholders complete their first layout against that intermediate transform state and end up vertically offset (issue Tencent#4551). Promote the dialog content and nested input to their own composited layer so the placeholder layout is computed from the settled geometry.
小程序真机环境不支持 Unicode 属性转义(\p{L}\p{N}\p{P}\p{S}),
chat-markdown 在非 APP 端引用的 npm/marked/index.js 内含
unicodeAlphaNumeric:/[\p{L}\p{N}]/u 等正则,模拟器(V8/JS Core 新版)
可解析,真机基础库解析直接抛
Invalid regular expression: /[\p{L}\p{N}]/u: Invalid property name。
与已有的 npm/marked/uniapp.js(APP 端专用)保持一致,将属性转义
替换为等价 ASCII 字符类:
- [\p{L}\p{N}] -> [A-Za-z0-9]
- [\p{P}\p{S}] 与 [\s\p{P}\p{S}] -> ASCII 标点符号类
(含 \s,与 uniapp.js 逐字符一致)
真机与模拟器均不再解析失败,CJK 加粗/标题/列表/链接等
markdown 词法分析行为不变。
H5 端图标字体(font-family: t)此前没有预加载:首个 t-icon-* 渲染进 DOM 后浏览器才发起 t.woff 请求,请求返回前图标显示为 占位方块(tofu),首次访问或弱网时中间态肉眼可见(issue Tencent#4710)。 新增 font-preload.ts:模块加载阶段通过 FontFace API 主动触发 字体加载,与 icon.less 的 @font-face 指向同一 URL,浏览器复用 同一请求不重复下载;幂等(缓存 Promise),失败静默回退到原有 CSS 触发路径。小程序/APP 端无 document.fonts,直接跳过。 icon.vue 引入该模块并在顶层调用 ensureIconFontLoaded(), 使字体请求提前到 bundle 求值阶段,早于首屏组件渲染。
input/textarea 的 onInput 此前把每次 input 事件的中间态通过
setData({value}) 回写给原生控件;Mac 端韩语等 IME 组合输入时,
回写会打断输入法组合态(composition 被重置),造成内容反复
闪烁(issue Tencent#4606)。原生 input 组件无此问题,因为从不回写。
修复原则:输入过程中原生控件本就显示用户输入的中间态,
仅在限长(maxcharacter/maxlength)会截断内容时才回写做受控
纠偏;其余情况只按限长规则同步计数并抛出 change(携带原始值)。
- onInput 非截断分支不再 setData value(消除组合态打断源)
- 新增 calculateCount(input)/复用 calculateValue(textarea)
保证计数语义与截断分支一致
- updateValue 相同值短路:只同步计数不回写
- 新增 value 属性 observer:外部(父组件)受控更新仍同步到
内部展示,内部输入值不经过 observer,避免互相打断
- 新增 ime-composition.test.js 回归测试(2 例)
lnuxe
force-pushed
the
fix/input-ime-flicker-4606
branch
from
November 17, 2026 02:04
f85d6a5 to
1018010
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 类型
相关 Issue
Fixes #4606
修改说明
问题
Mac 端输入韩语时,t-input / t-textarea 内容闪烁(见 issue 内录屏)。input、textarea 均存在;原生 input 组件没有此问题。
根因
组件的
onInput把每次 input 事件的值通过setData({ value })回写,而 wxml 中<input value="{{value}}">又绑定该值——形成「原生输入 → setData 回写 → 原生重新应用 value」的回环。韩语等 IME 组合输入时,每个 keystroke 的中间态都触发一次回写;原生控件在组合会话进行中被重新应用 value 会重置 IME 组合态,导致文字反复消失/重绘,即肉眼可见的闪烁。原生 input 不回写,因此无此问题。
修复
核心原则:原生控件本就显示用户正在输入的中间态,无需回写确认。
setData({value})回写 → 打断 IMEinput 新增
calculateCount(与截断分支同一套 maxcharacter/maxlength 计数语义);textarea 直接复用既有calculateValue。验证
既有 maxcharacter 受控截断用例(CJK 计数 9 等)全部保持通过。
自检