Giter Club home page Giter Club logo

srivastavaanurag79 / react-native-paper-select Goto Github PK

View Code? Open in Web Editor NEW
46.0 6.0 15.0 15.58 MB

Dropdown using React Native Paper TextInput, Checkbox and Dialog

Home Page: https://anurag-srivastava.gitbook.io/react-native-paper-select/

License: MIT License

JavaScript 4.42% Java 18.78% TypeScript 64.66% Swift 0.19% C 0.31% Objective-C 9.67% Ruby 1.97%
react-native react-native-paper react-native-paper-select multi-select dropdown android ios react typescript

react-native-paper-select's Introduction

React Native Paper Select ๐Ÿ”ฝ

kandi X-Ray Version Dependency Status License Package Quality

  • This module includes a customizable multi-select and a single select component for React Native Paper.
  • The package is both Android and iOS compatible.
  • The package is well-typed and supports TypeScript.
  • Smooth and fast.
  • Type-safe

Give us a GitHub star ๐ŸŒŸ, if you found this package useful. GitHub stars

Check out the new Documentation.

Check out the Example code or you can check the example source code in example module.

React Native Paper Select (NPM Link)

Demo/Screenshots

React Native Paper Select React Native Paper Select React Native Paper Select React Native Paper Select React Native Paper Select

Dependencies

react-native-paper
react-native-vector-icons

Installation

If you are using React Native Paper v5.x please install the versions above 0.4.1 or above, since <TextInput.Icon> attributes are changed in v5.x else version 0.4.0 would work fine.

npm install react-native-paper-select

or

yarn add react-native-paper-select

Customization Options

See the API docs

Try it out

You can run the example module by performing these steps:

git clone https://github.com/srivastavaanurag79/react-native-paper-select.git
cd react-native-paper-select && cd example
npm install
cd ios && pod install && cd ..
react-native run-ios
react-native run-android

Author

Contributors

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

react-native-paper-select's People

Contributors

bo7mid3 avatar carlossloureiro avatar imgbotapp avatar srivastavaanurag79 avatar thodor12 avatar wallacerenan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

react-native-paper-select's Issues

outlineColor in textInputProps is not working in iOs, but working fine in android

I have the following select, the issue is that the  outlineColor in textInputProps is ignored, it is always black

<PaperSelect
value={values.country}
onSelection={(value) => {
handleChange('country')(value.text);
}}
arrayList={countryList}
textInputMode="outlined"
selectedArrayList={[]}
errorText=""
activeOutlineColor={style.selectedOuterInput}
multiEnable={false}
checkboxProps={{
checkboxColor: style.selectedOuterInput,
checkboxLabelStyle: { color: 'black' },
}}
textInputProps={{
activeOutlineColor: style.selectedOuterInput,
outlineColor: getOutlineColor(
errors,
touched,
'country',
style,
),
}}
/>

Using testID

Hi,

Unfortunately, there is no testID that can be provided to enable the use of testing solutions.

Is it possible to add testID support ?

Cheers,
Luc

More customization

Hey there, really really love this select... i was hoping if there is a way we can customise more of this select, for example reduce the modal box size(height and width), use custom font, for example how the react native paper textInput allows to utilize your custom font...
pic2
pic1

Use Paper theme by default

I thought this package would use PaperProvider theme by default, and while technically it does, it also overrides styles meaning the theme is ignored.

E.g. I useMD3DarkTheme for dark mode, but the styling for the TextInput is overridden because it uses its own styles.

textInput: {
    backgroundColor: '#fff',
    color: '#000',
  },

here

Is this intentional? Would you accept a PR to change it?

Same for the dialog background color

Long wrapped checkbox label are not aligned

Hi @srivastavaanurag79

For some check boxes the labels are very long so they were going out of modal width like below:

image

so I tried wrapping them around using
checkboxLabelStyle={{ flex: 1, flexWrap: 'wrap' }}

The wrapping of text is working fine but they are not appropriately aligned.
I have tried applying width, textAlign, selfAlign, flexShrink and other CSS properties but the alignment remains the same.
Here is the image.

image

Could you please have a look and help me with the solution?

How to update the value dynamically after api call

Hi, Please help me on this,

I am new to React Native, i am using this control, but its value is not changing after api response, i need to update its value dynamically.

    const rd = [];
    response.data.data.map((data) => {
      rd.push({
         _id: data.id.toString(),
         value: data.employee,
       });
     });

        setReporting({
          list:rd,
          value: value.text,
          selectedList: value.selectedList,
          error: '',
        });

I am using above code but its not working.

Support for left icon

First of all thanks for the component, it has been useful for my use case.
However, I noticed that there is no prop that allows me to put the icon on the left in the input. I read that the component's base is TextInput so I think it is possible.

Cannot read property 'level3' of undefined

This error is located at:
in Dialog (created by PaperSelect)
in ThemeProvider
in RCTView (created by View)
in View (created by PortalManager)
in PortalManager (created by Portal.Host)
in Portal.Host (created by PaperProvider)
in RCTView (created by View)
in View (created by SafeAreaInsetsContext)
in SafeAreaProviderCompat (created by PaperProvider)
in PaperProvider (created by RootLayout)
in Provider (created by RootLayout)
in RootLayout
in Unknown (created by Route())
in Route (created by Route())
in Route() (created by ContextNavigator)
in RNCSafeAreaProvider (created by SafeAreaProvider)
in SafeAreaProvider (created by wrapper)
in RNGestureHandlerRootView (created by GestureHandlerRootView)
in GestureHandlerRootView (created by GestureHandlerRootView)
in GestureHandlerRootView (created by wrapper)
in wrapper (created by ContextNavigator)
in EnsureSingleNavigator
in BaseNavigationContainer
in ThemeProvider
in NavigationContainerInner (created by ContextNavigator)
in ContextNavigator (created by ExpoRoot)
in ExpoRoot (created by App)
in App (created by withDevTools(App))
in withDevTools(App) (created by ErrorOverlay)
in ErrorToastContainer (created by ErrorOverlay)
in ErrorOverlay
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in main(RootComponent), js engine: hermes

Component is very slow to use on Android

Hi, I'm using the component with Formik, and it's very slow: it takes a lot to open the dialog and a lot of time when closing the dialog after clicking on Done. I haven't tested on iPhone yet.

TypeScript Support

Hello! Thanks for sharing this library. How does one add typing to this library for use with TypeScript?

Cannot apply textInputStyle color

Hi,
Firstly, many thank's for your great work !! ๐Ÿ‘
Is there any way to change the textInputStyle color ?
when I use textInputStyle={{ color: '#222222', fontWeight: '800' }}, fontWeight is modified but not color. Any Idea ?
I tried this way :
<Controller name="masque" control={control} render={({ field: { onChange, value } }) => ( <PaperSelect label="Masques" value={value} textInputMode="outlined" textInputStyle={{ color: '#222222', fontWeight: '800' }} onSelection={(value: any) => { setMasqueList({ ...masqueList, value: value.text, selectedList: value.selectedList, error: '', }); onChange(value.text); }} arrayList={[...masqueList.list]} selectedArrayList={masqueList.selectedList} errorText={masqueList.error} multiEnable={false} hideSearchBox={true} dialogTitleStyle={{ color: '#4BAFBF' }} textInputProps={{ underlineColor: '#e74c3c', outlineColor: '#cecece', activeOutlineColor: '#4BAFBF', }} checkboxProps={{ checkboxColor: '#4BAFBF', checkboxUncheckedColor: '#e74c3c', }} searchbarProps={{ iconColor: 'brown', }} searchText="Rechercher" dialogCloseButtonText="Annuler" dialogDoneButtonText="Valider" dialogCloseButtonStyle={{ color: '#e74c3c' }} dialogDoneButtonStyle={{ color: 'white', backgroundColor: '#1abc9c', padding: 9, borderRadius: 5, overflow: 'hidden' }} theme={{ colors: { onSurfaceVariant: '#cecece', }, }} /> )} />

translation

there is an way to translate "done" and "search" texts to other language?

first click on android doesn't work

Every time I open the dialog in android device, first time I click on an option, it isn't being picked but on the second click it works flawless. Is there a fix for it?

Unable to change option color

is there any way to change the option text color
image

in this scenario where the background color is white, it is "White Text On A White Background"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.