summaryrefslogtreecommitdiffstats
path: root/ui/src/components/post-form.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-12-15 11:29:50 -0800
committerDessalines <tyhou13@gmx.com>2019-12-15 11:29:50 -0800
commitea3adad87812f535c57b8212f4de65a3e708bb15 (patch)
treedd199ac9d4b804b420227e5213ec455473927748 /ui/src/components/post-form.tsx
parent2346f30e0e81533f1792d4aec19f1e4c5b3b7240 (diff)
Fixing suggested title filling.
Diffstat (limited to 'ui/src/components/post-form.tsx')
-rw-r--r--ui/src/components/post-form.tsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/src/components/post-form.tsx b/ui/src/components/post-form.tsx
index 9bfa7063..cd5a8112 100644
--- a/ui/src/components/post-form.tsx
+++ b/ui/src/components/post-form.tsx
@@ -80,7 +80,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
this.state.postForm = {
body: this.props.post.body,
// NOTE: debouncing breaks both these for some reason, unless you use defaultValue
- name: this.props.post.name,
+ name: undefined,
community_id: this.props.post.community_id,
edit_id: this.props.post.id,
creator_id: this.props.post.creator_id,
@@ -209,7 +209,11 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
</label>
<div class="col-sm-10">
<textarea
- defaultValue={this.state.postForm.name}
+ defaultValue={
+ this.props.post ? this.props.post.name : undefined
+ }
+ /* This needs to be undefined for some weird reason */
+ value={this.state.postForm.name}
onInput={linkEvent(this, this.handlePostNameChange)}
class="form-control"
required