[MM-63481] Don't substract keyboard height in Android as it was already substracted (#8697)
* don't substract keyboard height in Android as it was already substracted
This commit is contained in:
parent
f4685b8db3
commit
60d4e95229
2 changed files with 4 additions and 4 deletions
|
|
@ -52,6 +52,7 @@ function PostDraft({
|
|||
const [postInputTop, setPostInputTop] = useState(0);
|
||||
const [isFocused, setIsFocused] = useState(false);
|
||||
const keyboardHeight = useKeyboardHeight();
|
||||
const kbHeight = Platform.OS === 'ios' ? keyboardHeight : 0; // useKeyboardHeight is already deducting the keyboard height on Android
|
||||
const headerHeight = useDefaultHeaderHeight();
|
||||
const serverUrl = useServerUrl();
|
||||
|
||||
|
|
@ -61,9 +62,8 @@ function PostDraft({
|
|||
setCursorPosition(message.length);
|
||||
}, [channelId, rootId]);
|
||||
|
||||
const autocompletePosition = AUTOCOMPLETE_ADJUST + keyboardHeight + postInputTop;
|
||||
const autocompletePosition = AUTOCOMPLETE_ADJUST + kbHeight + postInputTop;
|
||||
const autocompleteAvailableSpace = containerHeight - autocompletePosition - (isChannelScreen ? headerHeight : 0);
|
||||
|
||||
const [animatedAutocompletePosition, animatedAutocompleteAvailableSpace] = useAutocompleteDefaultAnimatedValues(autocompletePosition, autocompleteAvailableSpace);
|
||||
|
||||
if (channelIsArchived || deactivatedChannel) {
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ export const useAutocompleteDefaultAnimatedValues = (position: number, available
|
|||
|
||||
useEffect(() => {
|
||||
animatedPosition.value = position;
|
||||
}, [position]);
|
||||
}, [position, animatedPosition]);
|
||||
|
||||
useEffect(() => {
|
||||
animatedAvailableSpace.value = availableSpace;
|
||||
}, [availableSpace]);
|
||||
}, [availableSpace, animatedAvailableSpace]);
|
||||
|
||||
return [animatedPosition, animatedAvailableSpace];
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue