JSFiddle - React, Tailwind, and code Playground
by Marcus Mateo
HTML
<div id="editableDiv" contentEditable="true" style="min-height: 200px; border: solid 1px #0099FF;"><p style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; color: rgb(51, 51, 51); font-family: sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 21px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">Once you've assigned autosize to an element, you can manually trigger the resize event by using the 'autosize:update' event. Autosize has no way of knowing when a script has changed the value of a textarea element, or when the textarea element styles have changed, so this event would be used instruct autosize to resize the textarea.</p><pre style="box-sizing: border-box; margin: 0px 0px 14px; padding: 0px; border: 0px; color: rgb(51, 51, 51); font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 21px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"><code class="language-javascript" style="box-sizing: border-box; margin: 0px; padding: 15px; border: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 13px; font-family: Consolas, monospace; line-height: inherit; display: block; position: relative; overflow: auto; border-radius: 6px; background: rgb(247, 247, 247);"><span class="hljs-keyword" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; color: rgb(51, 51, 51); font-weight: bold;">var</span> ta = <span class="hljs-built_in" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; color: rgb(0, 134, 179);">document</span>.querySelector(<span...