mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-20 20:01:56 +03:00
solved keyboard not opening bug and removed unused code
This commit is contained in:
parent
b43e256a83
commit
a1deef1913
@ -178,7 +178,10 @@ const MarkdownEditorView = ({
|
||||
|
||||
useEffect(() => {
|
||||
if (autoFocusText && inputRef && inputRef.current && draftBtnTooltipRegistered) {
|
||||
inputRef.current.focus();
|
||||
// added delay to open keyboard, solves the issue of keyboard not opening
|
||||
setTimeout(() => {
|
||||
inputRef.current.focus();
|
||||
}, 1000);
|
||||
}
|
||||
}, [autoFocusText]);
|
||||
|
||||
|
@ -28,25 +28,9 @@ const QuickReplyModal = ({}: QuickReplyModalProps, ref) => {
|
||||
const [selectedPost, setSelectedPost] = useState(null);
|
||||
const [commentValue, setCommentValue] = useState('');
|
||||
const [isSending, setIsSending] = useState(false);
|
||||
const [isKeyboardVisible, setKeyboardVisible] = useState(false);
|
||||
const sheetModalRef = useRef<ActionSheet>();
|
||||
const inputRef = useRef<TextInput>(null);
|
||||
|
||||
// keyboard listener hook for checking if keyboard is active/inactove
|
||||
useEffect(() => {
|
||||
const keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', () => {
|
||||
setKeyboardVisible(true); // or some other action
|
||||
});
|
||||
const keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => {
|
||||
setKeyboardVisible(false); // or some other action
|
||||
});
|
||||
|
||||
return () => {
|
||||
keyboardDidHideListener.remove();
|
||||
keyboardDidShowListener.remove();
|
||||
};
|
||||
}, []);
|
||||
|
||||
// reset the state when post changes
|
||||
useEffect(() => {
|
||||
setCommentValue('');
|
||||
@ -69,7 +53,6 @@ const QuickReplyModal = ({}: QuickReplyModalProps, ref) => {
|
||||
// handle close press
|
||||
const _handleClosePress = () => {
|
||||
sheetModalRef.current?.setModalVisible(false);
|
||||
setKeyboardVisible(false);
|
||||
};
|
||||
// navigate to post on summary press
|
||||
const _handleOnSummaryPress = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user