-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #212 from Peersyst/rnc/fix/avoid-keyboard
fix(rnc): avoid keyboard on android
- Loading branch information
Showing
5 changed files
with
40 additions
and
6 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
packages/genesys/packages/react-native-components/CHANGELOG.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...ages/genesys/packages/react-native-components/playground/playgrounds/Modal.playground.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Button, Modal, ModalProps, Row, ScrollView, TextField } from "../../src"; | ||
import playground from "../playground"; | ||
import { useState } from "react"; | ||
import styled from "@peersyst/react-native-styled"; | ||
|
||
export const StyledModal = styled(Modal)(({ safeAreaInsets, dimensions }) => ({ | ||
position: "absolute", | ||
bottom: Math.max(safeAreaInsets.bottom, 20), | ||
minWidth: "100%", | ||
maxWidth: dimensions.width - 40, | ||
maxHeight: dimensions.height * 0.9, | ||
borderRadius: 16, | ||
padding: 0, | ||
backgroundColor: "white", | ||
})); | ||
|
||
const Wrapper = (props: ModalProps): JSX.Element => { | ||
const [open, setOpen] = useState(false); | ||
return ( | ||
<Row style={{}}> | ||
<StyledModal open={open} {...props} avoidKeyboard={true} onClose={() => setOpen(false)}> | ||
<ScrollView style={{ flex: 1 }}> | ||
<TextField label="Test" /> | ||
</ScrollView> | ||
</StyledModal> | ||
<Button onPress={() => setOpen(true)}>Open</Button> | ||
</Row> | ||
); | ||
}; | ||
|
||
export default playground("Modal", Wrapper, {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters