Skip to content
New issue

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

textarea width has changed, but the height has not been recalculated #373

Open
hehanli101 opened this issue Sep 4, 2019 · 0 comments
Open

Comments

@hehanli101
Copy link

<title>Simple Autosize for textareas</title> <style> * { padding: 0; margin: 0; box-sizing: border-box; } div { position:absolute; top: 20px; left: 40px; width: 800px; max-height: 600px; overflow: auto; } textarea { width: 100%; } </style>
<textarea disabled rows="2" cols="19">The coconut palm (also, cocoanut), Cocos nucifera, is a member of the family Arecaceae (palm family). It is the only accepted species in the genus Cocos.[2] The term coconut can refer to the entire coconut palm, the seed, or the fruit, which, botanically, is a drupe, not a nut. The spelling cocoanut is an archaicform of the word.[3] The term is derived from 16th-century Portuguese and Spanish coco, meaning "head" or "skull",[4] from the three small holes on the coconut shell that resemble human facial features.而反觀如果噶榮榮榮榮榮榮榮榮榮榮個人説的都是日日日</textarea>
</body>
<script src='../dist/autosize.js'></script>
<script src='../dist/jquery-3.3.1.min.js'></script>
<script>
	autosize(document.querySelectorAll('textarea'));
setTimeout(function(){
	$('#root').append($('<li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li>'))
}, 5000);
</script>
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

No branches or pull requests

1 participant