We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
第137天 如何让textarea高度自适应呢?
The text was updated successfully, but these errors were encountered:
使用div的contenteditable属性模拟textarea,通过设定min-height 然后用高度慢慢撑高区域。
Sorry, something went wrong.
使用 div contenteditable 模拟的代价实在太大了。
推荐看看 ant-design 和 elementUI 的源码设计即可。
https://github.com/ElemeFE/element/blob/dev/packages/input/src/calcTextareaHeight.js#L73
https://github.com/ant-design/ant-design/blob/master/components/input/calculateNodeHeight.tsx#L88
用UI框架用习惯了,能想到的就是看框架源码。。
监听 input 事件,元素高度 = 元素可滚动高度
No branches or pull requests
第137天 如何让textarea高度自适应呢?
The text was updated successfully, but these errors were encountered: