mirror of
https://github.com/ecency/ecency-mobile.git
synced 2025-01-02 02:31:41 +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(() => {
|
useEffect(() => {
|
||||||
if (autoFocusText && inputRef && inputRef.current && draftBtnTooltipRegistered) {
|
if (autoFocusText && inputRef && inputRef.current && draftBtnTooltipRegistered) {
|
||||||
|
// added delay to open keyboard, solves the issue of keyboard not opening
|
||||||
|
setTimeout(() => {
|
||||||
inputRef.current.focus();
|
inputRef.current.focus();
|
||||||
|
}, 1000);
|
||||||
}
|
}
|
||||||
}, [autoFocusText]);
|
}, [autoFocusText]);
|
||||||
|
|
||||||
|
@ -28,25 +28,9 @@ const QuickReplyModal = ({}: QuickReplyModalProps, ref) => {
|
|||||||
const [selectedPost, setSelectedPost] = useState(null);
|
const [selectedPost, setSelectedPost] = useState(null);
|
||||||
const [commentValue, setCommentValue] = useState('');
|
const [commentValue, setCommentValue] = useState('');
|
||||||
const [isSending, setIsSending] = useState(false);
|
const [isSending, setIsSending] = useState(false);
|
||||||
const [isKeyboardVisible, setKeyboardVisible] = useState(false);
|
|
||||||
const sheetModalRef = useRef<ActionSheet>();
|
const sheetModalRef = useRef<ActionSheet>();
|
||||||
const inputRef = useRef<TextInput>(null);
|
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
|
// reset the state when post changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setCommentValue('');
|
setCommentValue('');
|
||||||
@ -69,7 +53,6 @@ const QuickReplyModal = ({}: QuickReplyModalProps, ref) => {
|
|||||||
// handle close press
|
// handle close press
|
||||||
const _handleClosePress = () => {
|
const _handleClosePress = () => {
|
||||||
sheetModalRef.current?.setModalVisible(false);
|
sheetModalRef.current?.setModalVisible(false);
|
||||||
setKeyboardVisible(false);
|
|
||||||
};
|
};
|
||||||
// navigate to post on summary press
|
// navigate to post on summary press
|
||||||
const _handleOnSummaryPress = () => {
|
const _handleOnSummaryPress = () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user