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

[FIX] Invalid font size for hiragana and katakana #559

Merged
merged 12 commits into from
Apr 20, 2021
23 changes: 23 additions & 0 deletions src/components/Composer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ export class Composer extends Component {
}

handleInput = (onChange) => () => {
if (this.state.inputLock) {
return;
}
onChange && onChange(sanitize(this.el.innerText));
}

Expand Down Expand Up @@ -147,6 +150,9 @@ export class Composer extends Component {

constructor(props) {
super(props);
this.state = {
inputLock: false,
};
this.value = this.props.value;
this.handleNotifyEmojiSelect = this.handleNotifyEmojiSelect.bind(this);

Expand Down Expand Up @@ -228,7 +234,13 @@ export class Composer extends Component {
return 0;
}

handleInputLock(locked) {
this.setState({ inputLock: locked });
return 0;
}

render = ({ pre, post, value, placeholder, onChange, onSubmit, onUpload, className, style }) => (

<div className={createClassName(styles, 'composer', { }, [className])} style={style}>
{pre}
<div
Expand All @@ -247,6 +259,17 @@ export class Composer extends Component {
onClick: this.handleClick,
}
)}

onCompositionStart={() => {
this.handleInputLock(true);
}}

onCompositionEnd={() => {
this.handleInputLock(false);
onChange && onChange(this.el.innerText);
}}


className={createClassName(styles, 'composer__input')}
/>
{post}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Messages/MessageText/emoji.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import shortnameToUnicode from '../../Emoji/shortnameToUnicode';

const emojiUnicode = '\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]'; // unicode emoji from https://www.regextester.com/106421
const emojiUnicode = '\u00a9|\u00ae|[\u2000-\u3039]|[\u3100-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]'; // unicode emoji from https://www.regextester.com/106421

const emojiRanges = [
emojiUnicode, // unicode emoji from https://www.regextester.com/106421
Expand Down