tableflip / react-native-select-multiple Goto Github PK
View Code? Open in Web Editor NEW☑️ A customiseable FlatList that allows you to select multiple rows
License: ISC License
☑️ A customiseable FlatList that allows you to select multiple rows
License: ISC License
It would be a nice if there's an optional prop to specify maximum number of items that can be selected. I don't know if there's a workaround for this (if so i'd be glad to hear about it, need it for a project ASAP).
Instead of rendering images only, it might be a better option to have that as default behaviour and enable users to render custom elements for checkboxSource
@alanshaw First, thank you very much for creating this library.
Is this currently maintained? It's a rather small package so easy enough to fork, but it would also be "good" to reduce forking if possible. I'm using this extensively in a react native app of mine and would love to help work through the open PRs and issues, if you need help.
Thanks again.
This issue describes the problem:
https://react-native.canny.io/feature-requests/p/listview-doesnt-render-rows-until-scroll
Does anyone have similar issue?
Hi, could you change this away from class components?
I want to see how it appears when created as functional or const components.
Thank you.
I want to change the position of checkbox from left to right side of the label. My requirement is like that. Any help in this issue will be appreciated.
my selectedCheckboxStyle is
{ width: 22, height: 22, borderWidth: 1, borderColor: "blue", backgroundColor: "blue", borderRadius: 4, color: "white", alignItems: "center", justifyContent: "center", },
everything is working fine, but the "check" in the checkbox is still the original color. Thanks.
How can we select all in this package? Thank you!
As per subject.
Much appreciated.
src/SelectMultiple.js : line 7, PropTypes.oneOfType - I believe should take in array.
I am receiving warning "Invalid argument supplied to oneOfType, expected an instance of array."
Fix would include square brackets like below -
const itemType = PropTypes.oneOfType([
PropTypes.string,
PropTypes.shape({ label: PropTypes.string, value: PropTypes.any })
])
Great Component, thanks :)
Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.
"dependencies": {
"react": "17.0.1",
"react-native": "0.64.0",
"react-native-select-multiple": "^2.1.0"
},
i want to get hte index value of selected item in select multiple and i have tried all the things like pass the index keyword in the function but its undefined
I have a specific selection from the options an if that checkbox is selected then I want to disable all the other checkboxes, is there a way we could do that?
Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
npx react-codemod rename-unsafe-lifecycles
in your project source folder.Please update the following components: %s, SelectMultiple
Im trying to style my selected checkbox to be a certain color but when i add styling to selectedCheckboxStyle prop it does nothing. The color only changes when i style the checkboxStyle prop. The issue is i only need the color to change if it is selected not if its not selected. SO i think there might be an issue here with your code.
If I compile my application on an android emulator everything is working as expected. However, If I compile my application on a real device, the checkbox is not working... The labels show up but not the actual checkbox so I can't select anything. Is anyone having this problem or it's just me?
Btw, my real device has an Android version of 5.1 (API 22) and my emulator has an API level of 23.
I recently updated to RN 0.59 and now see the "ListView is deprecated and will be removed in a future release" warning. I don't know when in the RN release schedule this change was made, but are there plans to update the package to use FlatList instead?
Related: #24, https://facebook.github.io/react-native/docs/listview,
hey I want a 8 coloums in row in list view is that possible ??
can be improve by uncheck the current selected and auto select the new one when maxSelect
=1
I am using RN version 0.58.5, and recently installed version 2.0.0 of this package, but cannot get the list rendered,
I have followed the documentation, the previous version works fine, but the version 2.0.0 doesn't show anything.
any suggestion on what i am doing wrong,
<SelectMultiple
items={this.state.sample}
selectedItems={this.state.selectedItems}
onSelectionsChange={this.onSelectionsChange}
/>
and the dataset is in the label,value type like so,
sample: [
{ label: "Item 1", value: 1 },
{ label: "Item 2", value: 2 },
],
Hi I would like to know how to render additional text views with label ?
Also If there is any possibility to provide the search functionality so that it's easier for the user when the list is long.
Thanks
The list will render with all possible selections but does not allow the user to scroll through the options when viewed on an Android device (tested with Pixel 2 XL, Pixel 3, Pixel 3 XL). Scrolling works on iOS without issues. Here's a glance at our code:
<View
style={{
height: 150,
borderWidth: 1,
borderColor: "#e1e8ee",
margin: 5
}}>
<SelectMultiple
keyExtractor={(item, index) => index.toString()}
items={this.state.audData[0]}
selectedItems={this.state.selectedAud}
onSelectionsChange={this.handleChange}
/>
</View>
Any advice?
Please change PropTypes from the react component with the PropTypes from the prop-types component to support React 15.5 or higher.
import React, { Component } from 'react';
import PropTypes from 'prop-types';
TypeError: Cannot read property 'oneOfType' of undefined
at Object. (node_modules/react-native-select-multiple/src/SelectMultiple.js:7:30)
From the docs, the first arguemnt of the method onSelectionsChange
should be a list of the selected items as follows:
[
{
label: 'car',
value: 'car-item-id'
},
{
label: 'bike',
value: 'bike-item-id'
}
]
But instead I'm getting:
[
{
label: 'car',
value: 'car-item-id'
},
{
label: 'bike',
value: 'bike-item-id',
selected: false // <<< Notice
}
]
Hey, i have a list which is long and i cant render a button at the bottom because there is no option to add renderFooter prop.
first :thanks for your component 👍
when in want style my row with selectedRowStyle={{backgroundColor:'gray'}}
it's OK
but when try to
selectedRowStyle={{backgroundColor:'gray',color:'red'}}
it doesn't effect the row color
It would be nice to can deleting an object by swipping the view of the desired object in list
Please add checkbox images to \node_modules\react-native-select-multiple\images\ folder when using the NPM installer
bundling failed: "Unable to resolve module ../images/icon-checkbox.png
\node_modules\react-native-select-multiple\images\icon-checkbox.png'
Thanks, Adri
Please look into this.
After the last commit regarding missing square-brackets, the npm package needs updating.
Hey is there a possibility to filter the entries of the list?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.