react-native-modal-dropdown icon indicating copy to clipboard operation
react-native-modal-dropdown copied to clipboard

Add Icon Right to unexpanded field

Open MeKyleH opened this issue 7 years ago • 5 comments

Before the dropdown is expanded we should be able to give it an icon on the right hand side. For example, a down facing chevron from vector icons. That would be great, thanks!

MeKyleH avatar May 15 '18 20:05 MeKyleH

I would like this feature as well, if I have time, I will try to work on it and send a PR. This package is great, but it misses couple of stuff to make it even better.

varqasim avatar May 26 '18 17:05 varqasim

Try this https://github.com/Kishanjvaghela/react-native-modal-dropdown

Added support for renderRightComponent.

Now you can render anything in right side including icon as well.

<ModalDropdown
            isFullWidth
            textStyle={{ flex: 1 }}
            renderRightComponent={() => (
              <Image />
            )}
            {...rest} />

Kishanjvaghela avatar Oct 26 '20 12:10 Kishanjvaghela

it looks like the latest version does not have renderRightComponent nor renderButtonComponent in its props. When I use it, it works but I get typescript error:

Property 'renderRightComponent' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<ModalDropdown> & Readonly<ModalDropdownProps> & Readonly<...>'.

Is this by design?

Baloc22m avatar Dec 03 '21 05:12 Baloc22m

Try this https://github.com/Kishanjvaghela/react-native-modal-dropdown

Added support for renderRightComponent.

Now you can render anything in right side including icon as well.

<ModalDropdown
            isFullWidth
            textStyle={{ flex: 1 }}
            renderRightComponent={() => (
              <Image />
            )}
            {...rest} />

How can we change the icon like chevron facing up when dropdown is opened and facing down when it's not? Is there any prop for that?

Raheel1258 avatar Feb 16 '22 10:02 Raheel1258