Fixing suggested title filling.
This commit is contained in:
parent
2346f30e0e
commit
ea3adad878
1 changed files with 6 additions and 2 deletions
8
ui/src/components/post-form.tsx
vendored
8
ui/src/components/post-form.tsx
vendored
|
@ -80,7 +80,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
|
||||||
this.state.postForm = {
|
this.state.postForm = {
|
||||||
body: this.props.post.body,
|
body: this.props.post.body,
|
||||||
// NOTE: debouncing breaks both these for some reason, unless you use defaultValue
|
// 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,
|
community_id: this.props.post.community_id,
|
||||||
edit_id: this.props.post.id,
|
edit_id: this.props.post.id,
|
||||||
creator_id: this.props.post.creator_id,
|
creator_id: this.props.post.creator_id,
|
||||||
|
@ -209,7 +209,11 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
|
||||||
</label>
|
</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<textarea
|
<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)}
|
onInput={linkEvent(this, this.handlePostNameChange)}
|
||||||
class="form-control"
|
class="form-control"
|
||||||
required
|
required
|
||||||
|
|
Loading…
Reference in a new issue