Composer: Fix space when editing text (#5862)
This commit is contained in:
parent
888e740b39
commit
a72abc5cbc
@ -25,7 +25,7 @@ import captureKeyboardListeners from '../../../util/captureKeyboardListeners';
|
||||
import { getIsDirectTextInputDisabled } from '../../../util/directInputManager';
|
||||
import parseEmojiOnlyString from '../../../util/emoji/parseEmojiOnlyString';
|
||||
import focusEditableElement from '../../../util/focusEditableElement';
|
||||
import { debounce } from '../../../util/schedulers';
|
||||
import { debounce, fastRaf } from '../../../util/schedulers';
|
||||
import renderText from '../../common/helpers/renderText';
|
||||
import { isSelectionInsideInput } from './helpers/selection';
|
||||
|
||||
@ -208,6 +208,8 @@ const MessageInput: FC<OwnProps & StateProps> = ({
|
||||
? MAX_ATTACHMENT_MODAL_INPUT_HEIGHT
|
||||
: isStoryInput ? MAX_STORY_MODAL_INPUT_HEIGHT : (isMobile ? 256 : 416);
|
||||
const updateInputHeight = useLastCallback((willSend = false) => {
|
||||
// Defer to avoid animation/layout conflicts during DOM updates
|
||||
fastRaf(() => {
|
||||
requestForcedReflow(() => {
|
||||
const scroller = inputRef.current!.closest<HTMLDivElement>(`.${SCROLLER_CLASS}`)!;
|
||||
const currentHeight = Number(scroller.style.height.replace('px', ''));
|
||||
@ -239,6 +241,7 @@ const MessageInput: FC<OwnProps & StateProps> = ({
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (!isAttachmentModalInput) return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user