1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-07 21:47:02 +09:00

code review

This commit is contained in:
Andrew Simachev 2025-06-06 08:42:57 +02:00
parent e96ab859b5
commit 1220d0690a
No known key found for this signature in database
GPG key ID: 1DFE44B21443F0EF

View file

@ -69,8 +69,6 @@ const Editable = forwardRef<EditableRefProps, Props>(({
const cnw = [ 'editableWrap', classNameWrap ];
const cne = [ 'editable', classNameEditor ];
const cnp = [ 'placeholder', classNamePlaceholder ];
// Add a ref to track if composition just ended
const justEndedComposition = useRef(false);
const placeholderCheck = () => {
@ -142,7 +140,8 @@ const Editable = forwardRef<EditableRefProps, Props>(({
if (justEndedComposition.current) {
justEndedComposition.current = false;
return;
}
};
placeholderCheck();
if (onInput) {
@ -207,6 +206,7 @@ const Editable = forwardRef<EditableRefProps, Props>(({
const onCompositionEndHandler = (e: any) => {
keyboard.setComposition(false);
justEndedComposition.current = true;
if (onCompositionEnd) {
onCompositionEnd(e, getTextValue(), getRangeHandler());
};