Skip to content

Commit fdc213a

Browse files
authored
PERF: Use fixed-height textarea in note form (#36650)
The ExpandingTextArea component uses the autosize library, which triggers expensive DOM measurements (scrollHeight calculations) on every keystroke. This causes layout thrashing, especially problematic in the review queue, where multiple textareas may be rendered. <img width="801" height="851" alt="Screenshot 2025-12-12 at 12 40 36 pm" src="https://github.com/user-attachments/assets/26d00693-e637-4c4a-8cde-6f91596139f5" />
1 parent 7955a47 commit fdc213a

File tree

1 file changed

+6
-12
lines changed
  • frontend/discourse/app/components/reviewable-refresh

1 file changed

+6
-12
lines changed

frontend/discourse/app/components/reviewable-refresh/note-form.gjs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import Component from "@glimmer/component";
2-
import { fn, hash } from "@ember/helper";
2+
import { hash } from "@ember/helper";
33
import { action } from "@ember/object";
44
import { service } from "@ember/service";
55
import { isEmpty } from "@ember/utils";
6-
import ExpandingTextArea from "discourse/components/expanding-text-area";
76
import Form from "discourse/components/form";
87
import PluginOutlet from "discourse/components/plugin-outlet";
98
import lazyHash from "discourse/helpers/lazy-hash";
@@ -102,16 +101,11 @@ export default class ReviewableNoteForm extends Component {
102101
as |field|
103102
>
104103
<div class="reviewable-note-form__textarea-wrapper">
105-
<field.Custom>
106-
<ExpandingTextArea
107-
@value={{field.value}}
108-
@input={{fn this.handleInput field.set}}
109-
@name={{field.name}}
110-
placeholder={{i18n "review.notes.placeholder"}}
111-
class="reviewable-note-form__textarea"
112-
rows="1"
113-
/>
114-
</field.Custom>
104+
<field.Textarea
105+
@height={{80}}
106+
placeholder={{i18n "review.notes.placeholder"}}
107+
class="reviewable-note-form__textarea"
108+
/>
115109
<PluginOutlet
116110
@name="reviewable-note-form-after-note"
117111
@connectorTagName="div"

0 commit comments

Comments
 (0)