diff --git a/packages/uni-mp-weixin/__tests__/component.spec.ts b/packages/uni-mp-weixin/__tests__/component.spec.ts
index a2684db8e488f16ec1e2994ed78a79c93ec27d67..ed988fd00fe3ee705bc1550dd01c5a993b8c70ff 100644
--- a/packages/uni-mp-weixin/__tests__/component.spec.ts
+++ b/packages/uni-mp-weixin/__tests__/component.spec.ts
@@ -17,6 +17,36 @@ describe('mp-weixin: transform component', () => {
code,
`(_ctx, _cache) => {
return {}
+}`
+ )
+ })
+ test('lazy element: textarea', () => {
+ assert(
+ ``,
+ ``,
+ `(_ctx, _cache) => {
+ return {}
+}`
+ )
+ assert(
+ ``,
+ ``,
+ `(_ctx, _cache) => {
+ return { a: _o(_ctx.input) }
+}`
+ )
+ assert(
+ ``,
+ ``,
+ `(_ctx, _cache) => {
+ return { a: _ctx.text, b: _o($event => _ctx.text = $event.detail.value) }
+}`
+ )
+ assert(
+ ``,
+ ``,
+ `(_ctx, _cache) => {
+ return _e({ a: _ctx.ok1 }, _ctx.ok1 ? { b: _o(_ctx.input) } : _ctx.ok2 ? {} : { d: _o(_ctx.input) }, { c: _ctx.ok2 })
}`
)
})
diff --git a/packages/uni-mp-weixin/dist/uni.compiler.js b/packages/uni-mp-weixin/dist/uni.compiler.js
index c768bbb544b29c80614f87449b570cef9615b62a..78f320a55263b3f761db60bec995177b3ed68295 100644
--- a/packages/uni-mp-weixin/dist/uni.compiler.js
+++ b/packages/uni-mp-weixin/dist/uni.compiler.js
@@ -80,6 +80,8 @@ const miniProgram = {
lazyElement: {
canvas: [{ name: 'bind', arg: ['canvas-id', 'id'] }],
editor: [{ name: 'on', arg: ['ready'] }],
+ // iOS 平台需要延迟
+ textarea: [{ name: 'on', arg: ['input'] }],
},
component: {
dir: COMPONENTS_DIR,
diff --git a/packages/uni-mp-weixin/src/compiler/options.ts b/packages/uni-mp-weixin/src/compiler/options.ts
index d3834c617429517e79578c68dcec01caa46d1c67..b6b1fe293bcd5406f45b26005e4729d52e358311 100644
--- a/packages/uni-mp-weixin/src/compiler/options.ts
+++ b/packages/uni-mp-weixin/src/compiler/options.ts
@@ -36,6 +36,8 @@ export const miniProgram: MiniProgramCompilerOptions = {
lazyElement: {
canvas: [{ name: 'bind', arg: ['canvas-id', 'id'] }],
editor: [{ name: 'on', arg: ['ready'] }],
+ // iOS 平台需要延迟
+ textarea: [{ name: 'on', arg: ['input'] }],
},
component: {
dir: COMPONENTS_DIR,