mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-12 12:04:16 +00:00
fix input changes
This commit is contained in:
parent
6522894530
commit
128f09a973
@ -107,6 +107,10 @@ export default class LiveChat extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleInputChange = (e) => {
|
handleInputChange = (e) => {
|
||||||
|
if (e.target.value[0] === " " || e.target.value[0] === "\n") {
|
||||||
|
e.target.value = e.target.value.slice(1)
|
||||||
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
writtedMessage: e.target.value
|
writtedMessage: e.target.value
|
||||||
})
|
})
|
||||||
@ -124,12 +128,13 @@ export default class LiveChat extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
scrollTimelineToBottom = () => {
|
scrollTimelineToBottom = () => {
|
||||||
// scroll to bottom smoothly
|
if (this.timelineRef.current) {
|
||||||
this.timelineRef.current.scrollTo({
|
this.timelineRef.current.scrollTo({
|
||||||
top: this.timelineRef.current.scrollHeight,
|
top: this.timelineRef.current.scrollHeight,
|
||||||
behavior: "smooth"
|
behavior: "smooth"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
componentDidMount = async () => {
|
componentDidMount = async () => {
|
||||||
await this.joinSocketRoom()
|
await this.joinSocketRoom()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user