File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -25,12 +25,19 @@ export default class Discussions extends React.Component {
2525 } )
2626
2727 const textValue = document . getElementById ( 'textarea' ) ;
28+ const btn_send = document . getElementById ( 'btn_send' ) ;
2829 textValue . addEventListener ( 'keypress' , event => {
2930 if ( event . keyCode === 13 ) {
3031 this . _dataValue ( textValue ) ;
3132 event . preventDefault ( ) ;
3233 }
3334 } )
35+
36+ btn_send . addEventListener ( 'click' , ev => {
37+ ev . preventDefault ( ) ;
38+ this . _dataValue ( textValue ) ;
39+ } )
40+
3441 }
3542
3643 _dataValue ( valueMsj ) {
@@ -75,7 +82,7 @@ export default class Discussions extends React.Component {
7582 placeholder = "Write message..."
7683 autoComplete = "false"
7784 autoFocus = "true" > </ textarea >
78- < button type = "submit" >
85+ < button id = "btn_send" type = "submit" >
7986 < i className = "material-icons" > send</ i >
8087 </ button >
8188 </ form >
You can’t perform that action at this time.
0 commit comments