From 55b1672d25adc3580e263caece373c736f932bc7 Mon Sep 17 00:00:00 2001 From: Antony Kurniawan Date: Sat, 19 Oct 2024 18:30:01 +0000 Subject: [PATCH] fix broken textarea auto size the code taken from https://stackoverflow.com/questions/454202/creating-a-textarea-with-auto-resize --- example.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/example.js b/example.js index 3c64085..194442c 100644 --- a/example.js +++ b/example.js @@ -58,7 +58,13 @@ $(function(){ $(".json-logic-example .apply").click(); //Run em all on page ready //Dynamically resize all the text areas - $(".json-logic-example textarea").textareaAutoSize(); + $(".json-logic-example textarea").each(function () { + this.style.height = this.scrollHeight + "px"; + this.style.overflowY = "hidden"; + }).on("input", function () { + this.style.height = "auto"; + this.style.height = this.scrollHeight + "px"; + }); $("body").on("click", ".json-logic-example .turn", function(event){ $(event.target).closest(".json-logic-example")