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
323 stars 138 forks source link

Wrap text in a row #178

Closed brokerdim closed 6 months ago

brokerdim commented 7 months ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-select-dropdown@3.4.0 for the project I'm working on. I can't place long lines of text (for 2 lines, usually it is more than enough) in IOS into a single option row. Solutions written here don't help me (on iOS) https://github.com/AdelRedaa97/react-native-select-dropdown/issues/55

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-select-dropdown/src/SelectDropdown.js b/node_modules/react-native-select-dropdown/src/SelectDropdown.js
index 18f66b0..a744fd9 100644
--- a/node_modules/react-native-select-dropdown/src/SelectDropdown.js
+++ b/node_modules/react-native-select-dropdown/src/SelectDropdown.js
@@ -158,7 +158,7 @@ const SelectDropdown = (
             <View style={styles.dropdownCustomizedRowParent}>{renderCustomizedRowChild(item, index, isSelected)}</View>
           ) : (
             <Text
-              numberOfLines={1}
+              numberOfLines={2}
               allowFontScaling={false}
               style={mergeStyles(styles.dropdownRowText, rowTextStyle, isSelected && selectedRowTextStyle)}>
               {rowTextForSelection ? rowTextForSelection(item, index) : item.toString()}

This issue body was partially generated by patch-package.

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