Skip to content
This repository has been archived by the owner on May 12, 2022. It is now read-only.

Commit

Permalink
keyboardShouldPersistTaps="handled" keyboardDismissMode="on-drag"
Browse files Browse the repository at this point in the history
  • Loading branch information
dilan-dio4 committed Jun 4, 2021
1 parent 41b50a2 commit df4a09c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion native-example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2897,7 +2897,7 @@
"version" "0.1.2"

"easybase-react@github:easybase/easybase-react#dev":
"resolved" "git+ssh://git@github.com/easybase/easybase-react.git#7e4fb6b8d4505574563c3d45c87d23a47831992d"
"resolved" "git+ssh://git@github.com/easybase/easybase-react.git#41b50a2b0b9d17159330f8c329eeccad60309ebe"
"version" "2.1.15"
dependencies:
"easybasejs" "4.2.13"
Expand Down
6 changes: 4 additions & 2 deletions src/ui/NativeAuth/NativeAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState, lazy, Suspense, Fragment, useEffect } from 'react';
import { ThemeProvider } from 'styled-components/native';
import { defaultDictionary } from '../utils';
import { INativeAuth } from '../uiTypes';
import { Toast } from './components';
import { Toast, Container } from './components';

const { useEasybase } = require('easybase-react');

Expand Down Expand Up @@ -72,7 +72,9 @@ export default function ({ customStyles, children, dictionary, signUpFields }: I
return (
<ThemeProvider theme={typeof customStyles === "object" ? customStyles : {}}>
<Toast toastMessage={toastMessage} toastOpen={toastOpen} setToastOpen={setToastOpen} />
{getCurrentPage()}
<Container behavior="height">
{getCurrentPage()}
</Container>
</ThemeProvider>
)
}
Expand Down
10 changes: 8 additions & 2 deletions src/ui/NativeAuth/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ export const View = styled.View({
width: "100%"
});

export const Form = styled.KeyboardAvoidingView((props: any) => ({
flex: 1,
export const Form = styled.ScrollView((props: any) => ({
justifyContent: 'space-between',
alignItems: 'center',
backgroundColor: '#fff',
Expand All @@ -17,6 +16,12 @@ export const Form = styled.KeyboardAvoidingView((props: any) => ({
...(props.theme.form ? { ...props.theme.form } : {})
}))

export const Container = styled.KeyboardAvoidingView((props: any) => ({
flex: 1,
backgroundColor: '#fff',
...(props.theme.container ? { ...props.theme.container } : {})
}))

export const HeaderText = styled.Text((props: any) => ({
fontSize: 37,
fontWeight: "bold",
Expand Down Expand Up @@ -71,6 +76,7 @@ export const Input = styled.TextInput((props: any) => ({
const SecondaryButtonRoot = styled.TouchableOpacity((props: any) => ({
backgroundColor: 'transparent',
height: 35,
marginBottom: 35,
overflow: "visible",
...(props.theme.secondaryButtonRoot ? { ...props.theme.secondaryButtonRoot } : {})
}))
Expand Down
2 changes: 1 addition & 1 deletion src/ui/NativeAuth/pages/ForgotPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function ({ setCurrentPage, dictionary, toast }: INativePage) {

if (!onConfirm) {
return (
<Form behavior="padding">
<Form keyboardShouldPersistTaps="handled" keyboardDismissMode="on-drag">
<HeaderText>{dictionary.forgotPasswordHeader}</HeaderText>

<View>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/NativeAuth/pages/SignIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function ({ setCurrentPage, dictionary, toast }: INativePage) {
}

return (
<Form behavior="padding">
<Form keyboardShouldPersistTaps="handled" keyboardDismissMode="on-drag">
<HeaderText>{dictionary.signInHeader}</HeaderText>

<View>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/NativeAuth/pages/SignUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default function ({ setCurrentPage, dictionary, signUpFields, toast }: IS
}

return (
<Form behavior="padding">
<Form keyboardShouldPersistTaps="handled" keyboardDismissMode="on-drag">
<HeaderText>{dictionary.signUpHeader}</HeaderText>

<View>
Expand Down

0 comments on commit df4a09c

Please sign in to comment.