Skip to content

Commit

Permalink
Merge pull request #196 from hwaphon/feature/web-textarea-update-height
Browse files Browse the repository at this point in the history
feat(runtime-web): 通过 props 更改 value 属性值时自动更新 textarea 高度
  • Loading branch information
hwaphon authored May 6, 2024
2 parents e5ab9bc + 963e2aa commit 3e79f99
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/runtime-web/src/components/src/form/textarea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ export default class Textarea extends BaseElement implements IFormComponent {
}
break
}

case 'value': {
if (oldVal !== newVal) {
requestAnimationFrame(() => {
this._updateHeight()
})
}
break
}
}
}

Expand Down

0 comments on commit 3e79f99

Please sign in to comment.