Skip to content

Commit f69dda4

Browse files
Merge pull request #132 from robertqin86/master
feat: Include customisable tag container and tag font size
2 parents eaa5af3 + 50ac856 commit f69dda4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/react-native-multi-select.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ export default class MultiSelect extends Component {
4040
uniqueKey: PropTypes.string,
4141
tagBorderColor: PropTypes.string,
4242
tagTextColor: PropTypes.string,
43+
tagContainerStyle: ViewPropTypes.style,
44+
tagFontSize: PropTypes.number,
4345
fontFamily: PropTypes.string,
4446
tagRemoveIconColor: PropTypes.string,
4547
onSelectedItemsChange: PropTypes.func.isRequired,
@@ -170,17 +172,19 @@ export default class MultiSelect extends Component {
170172
return find(items, singleItem => singleItem[uniqueKey] === itemKey) || {};
171173
};
172174

173-
_displaySelectedItems = optionalSelctedItems => {
175+
_displaySelectedItems = optionalSelectedItems => {
174176
const {
175177
fontFamily,
178+
tagContainerStyle,
176179
tagRemoveIconColor,
177180
tagBorderColor,
181+
tagFontSize,
178182
uniqueKey,
179183
tagTextColor,
180184
selectedItems,
181185
displayKey
182186
} = this.props;
183-
const actualSelectedItems = optionalSelctedItems || selectedItems;
187+
const actualSelectedItems = optionalSelectedItems || selectedItems;
184188
return actualSelectedItems.map(singleSelectedItem => {
185189
const item = this._findItem(singleSelectedItem);
186190
if (!item[displayKey]) return null;
@@ -193,7 +197,8 @@ export default class MultiSelect extends Component {
193197
justifyContent: 'center',
194198
height: 40,
195199
borderColor: tagBorderColor
196-
}
200+
},
201+
tagContainerStyle || {}
197202
]}
198203
key={item[uniqueKey]}
199204
>
@@ -202,7 +207,7 @@ export default class MultiSelect extends Component {
202207
{
203208
flex: 1,
204209
color: tagTextColor,
205-
fontSize: 15
210+
fontSize: tagFontSize || 15
206211
},
207212
fontFamily ? { fontFamily } : {}
208213
]}

0 commit comments

Comments
 (0)