GithubHelp home page GithubHelp logo

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

View Code? Open in Web Editor NEW
51.0 5.0 17.0 15.81 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.28% Java 18.20% TypeScript 65.76% Swift 0.18% C 0.30% Objective-C 9.37% Ruby 1.91%
react-native react-native-paper react-native-paper-select multi-select dropdown android ios react typescript

react-native-paper-select's Introduction

Namaste ๐Ÿ™

I'm Anurag, a.k.a. Vivacious Vendace ๐Ÿ‘จ๐Ÿฝโ€๐Ÿ’ป

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  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

react-native-paper-select's Issues

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.

translation

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

ERROR Warning: TextInput.Icon: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

"react-native-paper": "^5.12.3",
"react-native-paper-select": "^1.1.1"

ERROR Warning: TextInput.Icon: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
in TextInput.Icon (created by PaperSelect)
in IconAdornment (created by TextInputAdornment)
in TextInputAdornment (created by TextInputOutlined)
in RCTView (created by View)
in View (created by TextInputOutlined)
in TextInputOutlined
in Unknown (created by PaperSelect)
in RCTView (created by View)
in View (created by PaperSelect)
in ThemeProvider (created by PaperSelect)
in PaperSelect (created by Formik)
in Formik (created by JoinNewSchemeScreen)
in RCTView (created by View)
in View (created by Card.Content)
in Card.Content (created by JoinNewSchemeScreen)
in RCTView (created by View)
in View (created by Card)
in RCTView (created by View)
in View (created by Animated(View))
in Animated(View)
in Unknown (created by Card)
in Card (created by JoinNewSchemeScreen)
in RCTView (created by View)
in View (created by JoinNewSchemeScreen)
in RCTView (created by View)
in View (created by ScrollView)
in RCTScrollView (created by ScrollView)
in ScrollView (created by ScrollView)
in ScrollView (created by JoinNewSchemeScreen)
in RCTView (created by View)
in View (created by JoinNewSchemeScreen)
in JoinNewSchemeScreen (created by SceneView)
in StaticContainer
in EnsureSingleNavigator (created by SceneView)
in SceneView (created by BottomTabView)
in RCTView (created by View)
in View (created by Screen)
in RCTView (created by View)
in View (created by Background)
in Background (created by Screen)
in Screen (created by BottomTabView)
in RNSScreen (created by Animated(Anonymous))
in Animated(Anonymous)
in Suspender (created by Freeze)
in Suspense (created by Freeze)
in Freeze (created by DelayedFreeze)
in DelayedFreeze
in InnerScreen (created by Screen)
in Screen (created by MaybeScreen)
in MaybeScreen (created by BottomTabView)
in RNSScreenContainer (created by ScreenContainer)
in ScreenContainer (created by MaybeScreenContainer)
in MaybeScreenContainer (created by BottomTabView)
in RCTView (created by View)
in View (created by SafeAreaProviderCompat)
in SafeAreaProviderCompat (created by BottomTabView)
in BottomTabView (created by BottomTabNavigator)
in PreventRemoveProvider (created by NavigationContent)
in NavigationContent
in Unknown (created by BottomTabNavigator)
in BottomTabNavigator (created by BottomTabNavigator)
in BottomTabNavigator (created by SceneView)
in StaticContainer
in EnsureSingleNavigator (created by SceneView)
in SceneView (created by CardContainer)
in RCTView (created by View)
in View (created by CardContainer)
in RCTView (created by View)
in View (created by CardContainer)
in RCTView (created by View)
in View
in CardSheet (created by Card)
in RCTView (created by View)
in View (created by Animated(View))
in Animated(View) (created by PanGestureHandler)
in PanGestureHandler (created by PanGestureHandler)
in PanGestureHandler (created by Card)
in RCTView (created by View)
in View (created by Animated(View))
in Animated(View) (created by Card)
in RCTView (created by View)
in View (created by Card)
in Card (created by CardContainer)
in CardContainer (created by CardStack)
in RNSScreen (created by Animated(Anonymous))
in Animated(Anonymous)
in Suspender (created by Freeze)
in Suspense (created by Freeze)
in Freeze (created by DelayedFreeze)
in DelayedFreeze
in InnerScreen (created by Screen)
in Screen (created by MaybeScreen)
in MaybeScreen (created by CardStack)
in RNSScreenContainer (created by ScreenContainer)
in ScreenContainer (created by MaybeScreenContainer)
in MaybeScreenContainer (created by CardStack)
in RCTView (created by View)
in View (created by Background)
in Background (created by CardStack)
in CardStack (created by HeaderShownContext)
in RCTView (created by View)
in View (created by SafeAreaProviderCompat)
in SafeAreaProviderCompat (created by StackView)
in RNGestureHandlerRootView (created by GestureHandlerRootView)
in GestureHandlerRootView (created by StackView)
in StackView (created by StackNavigator)
in PreventRemoveProvider (created by NavigationContent)
in NavigationContent
in Unknown (created by StackNavigator)
in StackNavigator (created by AppStackNavigator)
in AppStackNavigator (created by App)
in EnsureSingleNavigator
in BaseNavigationContainer
in ThemeProvider
in NavigationContainerInner (created by App)
in ThemeProvider (created by PaperProvider)
in RCTView (created by View)
in View (created by Portal.Host)
in Portal.Host (created by PaperProvider)
in RNCSafeAreaProvider (created by SafeAreaProvider)
in SafeAreaProvider (created by SafeAreaInsetsContext)
in SafeAreaProviderCompat (created by PaperProvider)
in PaperProvider (created by App)
in App (created by withDevTools(App))
in withDevTools(App)
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)

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

tsc compile error in `src/interface/paperSelect.interface.ts`

We are using src/interface/paperSelect.interface.ts in our ci/cd pipeline to make sure that there are no unused variables etc. in our react native application.

This emits the following error:

> npx tsc --noEmit -p . --pretty

node_modules/react-native-paper-select/src/interface/paperSelect.interface.ts:4:32 - error TS2307: Cannot find module 'react-native-paper/lib/typescript/src/types' or its corresponding type declarations.

4 import type { ThemeProp } from 'react-native-paper/lib/typescript/src/types';
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error in node_modules/react-native-paper-select/src/interface/paperSelect.interface.ts:4

We are using V1.1.1 of react-native-paper-select, together with V5.12.3 of react-native-paper

If I change import type { ThemeProp } from 'react-native-paper/lib/typescript/src/types'; in paperSelect.interface.ts to import { ThemeProp } from 'react-native-paper/lib/typescript/types';, no compile error occurs anymore

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?

TypeScript Support

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

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

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?

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.

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,
),
}}
/>

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', }, }} /> )} />

PaperSelect inside a Modal

Hi there,
I think I have some problems to open the select modal inside another modal, because when I click on select it doesn't open anything.
This is my code:

    <Portal>
      <Modal visible={visible} animationType="slide">
        <ScrollView>
          <PaperSelect />
        </ScrollView>
        <Toast />
      </Modal>
    </Portal>

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

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.

Close Dropdown Automatically on Selection When multipleEnable is false

Currently, when multipleEnable is set to false, the dropdown does not close automatically after a selection is made. This behavior can be improved to enhance user experience.

Feature Request:

  • Feature: If multipleEnable is false, the dropdown should close automatically after a selection is made.
  • Current Behavior: The dropdown remains open after a single selection.
  • Expected Behavior: The dropdown should automatically close after a selection is made, making it more intuitive for single-selection use cases.

Use Case
When using the dropdown in single-selection mode, users expect the dropdown to close immediately after a choice is made. This would streamline the user interface and improve usability.

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

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.