File tree Expand file tree Collapse file tree 3 files changed +30
-4
lines changed
javascripts/discourse/app Expand file tree Collapse file tree 3 files changed +30
-4
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { service } from "@ember/service";
8
8
import { isEmpty , isPresent } from "@ember/utils" ;
9
9
import { observes } from "@ember-decorators/object" ;
10
10
import BufferedProxy from "ember-buffered-proxy/proxy" ;
11
+ import { log } from "qunit" ;
11
12
import { Promise } from "rsvp" ;
12
13
import {
13
14
CLOSE_INITIATED_BY_BUTTON ,
@@ -374,6 +375,15 @@ export default class TopicController extends Controller {
374
375
}
375
376
}
376
377
378
+ @action
379
+ autoResize ( event ) {
380
+ const textArea = event . target ;
381
+ const scrollHeight = textArea . scrollHeight ;
382
+
383
+ textArea . style . height = "auto" ;
384
+ textArea . style . height = scrollHeight + "px" ;
385
+ }
386
+
377
387
@action
378
388
jumpTop ( event ) {
379
389
if ( event && wantsNewWindow ( event ) ) {
Original file line number Diff line number Diff line change
1
+ import { Textarea } from " @ember/component" ;
1
2
import { array , concat , fn , hash } from " @ember/helper" ;
2
3
import { on } from " @ember/modifier" ;
3
4
import { getProperties } from " @ember/object" ;
@@ -23,7 +24,6 @@ import SelectedPosts from "discourse/components/selected-posts";
23
24
import SharedDraftControls from " discourse/components/shared-draft-controls" ;
24
25
import SignupCta from " discourse/components/signup-cta" ;
25
26
import SlowModeInfo from " discourse/components/slow-mode-info" ;
26
- import TextField from " discourse/components/text-field" ;
27
27
import TopicAdminMenu from " discourse/components/topic-admin-menu" ;
28
28
import TopicCategory from " discourse/components/topic-category" ;
29
29
import TopicFooterButtons from " discourse/components/topic-footer-buttons" ;
@@ -120,11 +120,14 @@ export default RouteTemplate(
120
120
buffered =@ controller.buffered
121
121
}}
122
122
>
123
- <TextField
123
+ <Textarea
124
124
@ id =" edit-title"
125
125
@ value ={{@ controller.buffered.title }}
126
126
@ maxlength ={{@ controller.siteSettings.max_topic_title_length }}
127
- @ autofocus =" true"
127
+ autofocus =" true"
128
+ id =" edit-title"
129
+ {{on " input" @ controller.autoResize}}
130
+ {{on " focusin" @ controller.autoResize}}
128
131
/>
129
132
</PluginOutlet >
130
133
</div >
Original file line number Diff line number Diff line change 192
192
outline : 2px solid transparent ;
193
193
border-radius : var (--d-border-radius );
194
194
transition : outline ease-in-out 0.2s ;
195
- padding : 0.25rem ;
196
195
transition-delay : 0.1s ;
197
196
}
198
197
207
206
& .editing-topic {
208
207
transition : none ;
209
208
}
209
+
210
+ & .editing-topic #edit-title {
211
+ border : none ;
212
+ font-size : var (--font-up-4 );
213
+ line-height : var (--line-height-medium );
214
+ font-weight : bold ;
215
+ padding : 0 ;
216
+ resize : none ;
217
+ height : var (--font-up-4 );
218
+ }
219
+
220
+ & .editing-topic #edit-title :focus {
221
+ outline : none ;
222
+ }
210
223
}
211
224
212
225
& .can-edit-topic .title-wrapper .d-icon {
You can’t perform that action at this time.
0 commit comments