Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

[FIX] Rocket.Chat 3.0.12 Livechat issue about Korean IME #403 #538

Closed
wants to merge 1 commit into from

Conversation

ian902792
Copy link

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

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


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.

@ian902792
Copy link
Author

Contributor License Agreement page show "You have agreed to the CLA for RocketChat/Rocket.Chat.Livechat"
but GitHub comment's CLA status show " not signed yet".
So...?

@sctEdwin
Copy link
Contributor

sctEdwin commented Mar 8, 2021

May I asked when will this be merged?
Japanese IME conversion is also fixed by this pull request.

@@ -56,13 +56,17 @@ const replaceCaret = (el) => {
}
};

let inputLock = false;
Copy link
Contributor

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!inputLock) {
if (inputLock) {
return;
}
onChange && onChange(this.el.innerText);

@@ -246,6 +250,16 @@ export class Composer extends Component {
onClick: this.handleClick,
}
)}

oncompositionstart={(e)=>{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
oncompositionstart={(e)=>{
onCompositionStart={(e)=>{

Use camelCase to write event names: https://reactjs.org/docs/events.html#composition-events

@tiagoevanp
Copy link
Contributor

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

@tiagoevanp tiagoevanp closed this Jan 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants