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
320 stars 137 forks source link

DropDown display out of screen #56

Closed TristanMaurier98 closed 5 months ago

TristanMaurier98 commented 2 years ago

Hello developer friends, I noticed a small problem with the library when the button is on the right, the dropdown is displayed partly outside the screen. I made a fix for this if it is possible to have the authorization to create a pr that would be great. thank you in advance

image
TristanMaurier98 commented 2 years ago

modification: ligne 7: const {height, width} = Dimensions.get('window'); ligne 101 & 104:
if(px+dropdownWIDTH>width) { setDropdownPX(px-dropdownWIDTH+w); } else { setDropdownPX(px); }

TristanMaurier98 commented 2 years ago

I will also add that from where i stand line 106 setDropdownWIDTH(dropdownStyle?.width || w); should be before line 99 if (height - 18 < py + h + dropdownHEIGHT) {

TristanMaurier98 commented 2 years ago

And also line 7 const {height, width} = Dimensions.get('window'); should be before line 96 to be more responsive in web

AdelRedaa97 commented 5 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