react-native-toast-message icon indicating copy to clipboard operation
react-native-toast-message copied to clipboard

KeyboardOffset applied when keyboard is not open

Open Acex187x opened this issue 1 year ago • 1 comments

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:

  1. Add Toast to the App like this:
<Toast
  position={'bottom'}
  bottomOffset={0}
/>
  1. Call Toast.show({...})
  2. Zero gap between bottom of the screen and Toast expected when keyboard is closed, however ~10px gap exists.
  3. Add keyboardOffset={0} to the Toast component like this:
<Toast
  position={'bottom'}
  bottomOffset={0}
  keyboardOffset={0}
/>
  1. Gap disappears

Expected behavior keyboardOffset does not affect Toast layout while keyboard is not open.

Screenshots image

image

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.

Acex187x avatar Jun 12 '24 11:06 Acex187x

Have you checked out the documentation yet? It's not a bug; it's actually an "out of the box" feature 😐

ToastOptions:

  /**
   * Offset from the Keyboard (in px)
   * Has effect only when `position` is `bottom` and Keyboard is visible
   * Default value: `10`
   */
  keyboardOffset?: number;

Jeidoz avatar Jun 16 '24 13:06 Jeidoz