KeyboardOffset applied when keyboard is not open
Describe the bug
Using Toast component with bottomOffset={0} and position="bottom", there is still ~10px gap between end of the screen and toast, even with keyboard closed all the time. When keyboardOffset={0} is provided, gap disappears.
Steps to reproduce Steps to reproduce the behavior:
- Add Toast to the App like this:
<Toast
position={'bottom'}
bottomOffset={0}
/>
- Call
Toast.show({...}) - Zero gap between bottom of the screen and Toast expected when keyboard is closed, however ~10px gap exists.
- Add
keyboardOffset={0}to the Toast component like this:
<Toast
position={'bottom'}
bottomOffset={0}
keyboardOffset={0}
/>
- Gap disappears
Expected behavior
keyboardOffset does not affect Toast layout while keyboard is not open.
Screenshots
Code sample Provided above
Environment (please complete the following information):
- OS: [Android 12 (API 32)] (Not tested on other platforms)
- react-native-toast-message version: [v2.2.0]
- react-native version [v0.70.6]
Additional context It's my first issue, hope I did everything right. Do not hesitate to ask additional information.
Have you checked out the documentation yet? It's not a bug; it's actually an "out of the box" feature 😐
/**
* Offset from the Keyboard (in px)
* Has effect only when `position` is `bottom` and Keyboard is visible
* Default value: `10`
*/
keyboardOffset?: number;