-
Notifications
You must be signed in to change notification settings - Fork 232
[FIX] Rocket.Chat 3.0.12 Livechat issue about Korean IME #403 #538
Conversation
ian.yu seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Contributor License Agreement page show "You have agreed to the CLA for RocketChat/Rocket.Chat.Livechat" |
May I asked when will this be merged? |
@@ -56,13 +56,17 @@ const replaceCaret = (el) => { | |||
} | |||
}; | |||
|
|||
let inputLock = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you implement a global variable rather than an internal state variable?
export class Composer extends Component { | ||
handleRef = (el) => { | ||
this.el = el; | ||
} | ||
|
||
handleInput = (onChange) => () => { | ||
onChange && onChange(this.el.innerText); | ||
if (!inputLock) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!inputLock) { | |
if (inputLock) { | |
return; | |
} | |
onChange && onChange(this.el.innerText); |
@@ -246,6 +250,16 @@ export class Composer extends Component { | |||
onClick: this.handleClick, | |||
} | |||
)} | |||
|
|||
oncompositionstart={(e)=>{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oncompositionstart={(e)=>{ | |
onCompositionStart={(e)=>{ |
Use camelCase to write event names: https://reactjs.org/docs/events.html#composition-events
Thank you @ian902792 for the suggestion! In the future we will improve the composer as a more complex input component. For now is more concise to deal with the problem in that way: #674 |
This way can fix IME input method problem(Such as, Korean、Japanese、Chinese).
Because preact.js has SyntheticEvent issue.
Therefore, oncompositionstart & oncompositionend are all lowercase.
Reference