AdelRedaa97 / react-native-select-dropdown

react-native-select-dropdown is a highly customized dropdown | select | picker | menu for react native that works for andriod and iOS platforms.
MIT License
312 stars 133 forks source link

Dropdown position when the keyboard is shown #151

Closed marry1822 closed 3 months ago

marry1822 commented 11 months ago

Hey! I've got a strange behavior: if search is enabled and I open my dropdown, dropdown items jump up when keyboard is shown. See the attached screenshot:

image

Please, help me to fix it.

I expect it to look like this:

image
AdelRedaa97 commented 11 months ago

The dropdown is implemented using React native's Modal, and it positions the dropdown by calculating the position (X, Y)of the bottom in the screen, This behavior mey happens because the the dropdown is in a modal and it gets a wrong postion of Y, I will try to fix it this problem, But I want to know if this behavior happens if you put the button outside the Modal?

marry1822 commented 11 months ago

The dropdown is implemented using React native's Modal, and it positions the dropdown by calculating the position (X, Y)of the bottom in the screen, This behavior mey happens because the the dropdown is in a modal and it gets a wrong postion of Y, I will try to fix it this problem, But I want to know if this behavior happens if you put the button outside the Modal?

It happens in modal only, in IOS and Android.

It would be awesome if you could fix this behavior, because dropdowns are used in modals quite often. Thanks a lot!

AdelRedaa97 commented 11 months ago

I've tried to put in a Modal and it works fine, I've got a problem with the Android studio so I didn't try it on Android but it works fine on iOS

AdelRedaa97 commented 11 months ago

https://snack.expo.dev/@adelredaa97/rnsd-in-a-modal

Take a look here and tell me if the problem is solved.

marry1822 commented 11 months ago

https://snack.expo.dev/@adelredaa97/rnsd-in-a-modal

Take a look here and tell me if the problem is solved.

Not solved.. it jumps up or down on different screen resolutions (different ios devices) And it happens when search is enabled only.

AdelRedaa97 commented 3 months ago

Fixed in v4.0 take a look at the changes made in v4.0 https://github.com/AdelRedaa97/react-native-select-dropdown?tab=readme-ov-file#-major-changes

Feel free to open the issue again if it still exists