peacechen / react-native-modal-selector

A cross-platform (iOS / Android), selector/picker component for React Native that is highly customizable and supports sections.
MIT License
369 stars 129 forks source link

Modal not displaying #163

Open markl-vesper opened 3 years ago

markl-vesper commented 3 years ago

Hi

Seem to have run into an issue when attempting to open modal selector (v2.0.3) as part of onPress function within react-native-elements List Item & Button (v2.0.0)

Use case is as follows

We have a List Item configured with a title that calls a function to open the modal

title={this.renderWindDirectionSelect()}

and also a button as part of rightIcon as per below

                rightIcon: <Button
                    flex={.5}
                    title={value}
                    onPress={() => this.renderWindDirectionSelect()}
                    type="clear"
                    width='50%'
                />

When clicking on the list item the modal is displayed perfectly and updating the selected value updates the title of the button (value) perfectly as part of the function called renderWindDirectionSelect

However clicking on the button doesn't display any modal at all, although I can see the function logging stuff out to console so I know its being called

I considered updating elements but that just blew up the app with what looked to be some breaking changes.

any ideas??

markl-vesper commented 3 years ago

Update

Found that when adding a containerStyle property to the ListItem seems to break the modal. Based on that finding I have got a workaround in place now so the screen renders near enough to how I need and the modal works

peacechen commented 3 years ago

Good to hear that you found a solution. If any changes are required in RNMS, please submit a PR.