mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +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) => {
|
||||
if (e.target.value[0] === " " || e.target.value[0] === "\n") {
|
||||
e.target.value = e.target.value.slice(1)
|
||||
}
|
||||
|
||||
this.setState({
|
||||
writtedMessage: e.target.value
|
||||
})
|
||||
@ -124,11 +128,12 @@ export default class LiveChat extends React.Component {
|
||||
}
|
||||
|
||||
scrollTimelineToBottom = () => {
|
||||
// scroll to bottom smoothly
|
||||
this.timelineRef.current.scrollTo({
|
||||
top: this.timelineRef.current.scrollHeight,
|
||||
behavior: "smooth"
|
||||
})
|
||||
if (this.timelineRef.current) {
|
||||
this.timelineRef.current.scrollTo({
|
||||
top: this.timelineRef.current.scrollHeight,
|
||||
behavior: "smooth"
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount = async () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user