From 87722b750dd69ba49bf3012bcdf27b740971bb27 Mon Sep 17 00:00:00 2001
From: Guillem <guillembartrina@gmail.com>
Date: Fri, 17 Jul 2020 18:34:52 +0200
Subject: [PATCH] fix behaviour in the case width is 0

---
 pd/nw/pdgui.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js
index 8a99a6b8b..04f1ef0a8 100644
--- a/pd/nw/pdgui.js
+++ b/pd/nw/pdgui.js
@@ -5692,9 +5692,10 @@ function gui_textarea(cid, tag, type, x, y, width_spec, height_spec, text,
         p.style.setProperty("max-width",
             width_spec > 0 ? width_spec + "ch" : "60ch");
         p.style.setProperty("min-width",
-                is_gop == 1 ? (width_spec - 5) + "px" :
-                    (width_spec < 0 ? (-width_spec) + "px" : width_spec + "ch"));
-        
+            width_spec == 0 ? "3ch" :
+                (is_gop == 1 ? width_spec + "px" :
+                    (width_spec < 0 ? (-width_spec) + "px" : width_spec + "ch")));
+
         if (is_gop == 1) {
             p.style.setProperty("min-height", height_spec + "px");
         }
-- 
GitLab