File tree 1 file changed +10
-5
lines changed 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 4
4
5
5
<form @submit.prevent =" save(newComment)" class =" new-comment" >
6
6
<UserPhoto v-if =" user" :user =" user" ></UserPhoto >
7
- <input type =" text" :placeholder =" placeholder" v-model =" newComment.body" />
8
- <button type =" submit" class =" new-comment-submit" v-if =" newComment.body" >Post</button >
7
+ <input type =" text" :placeholder =" placeholder" v-model =" newComment.body" @input = " $event.target.composing = false " />
8
+ <button type =" submit" class =" new-comment-submit" v-if =" newComment.body.length > 0 " >Post</button >
9
9
</form >
10
10
11
11
<div v-if =" !errorMessage" class =" error" >{{ errorMessage }}</div >
82
82
v-if =" newReply && newReply.threadId === post.id"
83
83
>
84
84
<UserPhoto :user =" user" ></UserPhoto >
85
- <input type =" text" placeholder =" Reply to comment" v-model =" newReply.body" />
85
+ <input
86
+ type =" text"
87
+ placeholder =" Reply to comment"
88
+ v-model =" newReply.body"
89
+ @input =" $event.target.composing = false"
90
+ />
86
91
<button type =" submit" class =" new-comment-submit" v-if =" newReply.body" >Post</button >
87
92
</form >
88
93
</transition >
@@ -152,12 +157,12 @@ export default Vue.extend({
152
157
newComment: {
153
158
projectId: typeof this .parentData === " number" ? this .parentData : null ,
154
159
bookmark: null ,
155
- body: null ,
160
+ body: " " ,
156
161
},
157
162
newReply: {
158
163
projectId: typeof this .parentData === " number" ? this .parentData : null ,
159
164
bookmark: null ,
160
- body: null ,
165
+ body: " " ,
161
166
threadId: null ,
162
167
},
163
168
errorMessage: null ,
You can’t perform that action at this time.
0 commit comments