Giter Club home page Giter Club logo

react-native-sectioned-multi-select's Introduction

Netlify Status

renrizzolo.com

A simple portfolio site built with

Front

  • StencilJS
  • BodyMovin

Back

  • Node / Express
  • Quill
  • Multer

Stencil is a compiler for building fast web apps using Web Components.

Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec.

Stencil components are just Web Components, so they work in any major framework or with no framework at all. In many cases, Stencil can be used as a drop in replacement for traditional frontend frameworks given the capabilities now available in the browser, though using it as such is certainly not required.

Stencil also enables a number of key capabilities on top of Web Components, in particular Server Side Rendering (SSR) without the need to run a headless browser, pre-rendering, and objects-as-properties (instead of just strings).

Getting Started

To build the app for production, run:

npm run build

To start the development server, run:

npm run start

And access it on localhost:3333

To start the backend server, run:

npm run start.server

And access it on localhost:3000

To run the unit tests once, run:

npm test

To run the unit tests and watch for file changes during development, run:

npm run test.watch

react-native-sectioned-multi-select's People

Contributors

ayadav avatar bilal-abdeen avatar bmaximilian avatar brianreynolds28 avatar cloudx9 avatar davwheat avatar dependabot[bot] avatar fabicsp avatar fogg4444 avatar frankyfrankfrank avatar gregfenton avatar herdani avatar hmh84 avatar icodepup avatar imdkbj avatar jakeler avatar jimteva avatar jkarathiya avatar korzhenevski avatar marchi-martius avatar mcfly78 avatar n4com avatar oferrounds avatar qwertypomy avatar renrizzolo avatar sgr-fr avatar sinisa-steblaj-cmg avatar xmannv avatar yloliveira 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  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  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

react-native-sectioned-multi-select's Issues

selectToggle disappear when color background is setted

When I put selectToggle: {backgroundColor: 'red'}
the selectToggle disappear, and just appear chips

<SectionedMultiSelect
items={menuTags}
uniqueKey='id'
subKey='children'
selectText={I18n.t('add_meals')}
onSelectedItemsChange={this.onSelectedItemsChange}
selectedItems={ selectedMenuTags }
readOnlyHeadings={true}
showDropDowns={true}
expandDropDowns={true}
showCancelButton={true}
colors={{
chipColor: color.greenDark,
primary: selectedMenuTags.length? color.aqua : color.grayLight
}}
styles={{
chipText: styles.chip_text,
selectToggle: {backgroundColor: 'red'}
}}
onConfirm={this.handleSaveTags} />

Update schedule

I am very interested in your component, but I need some more functionality such as onConfirm in dev-branch.
So I was glad if I could add custom header component above searchBar.
May I know when changes about onConfirm will in master-branch?

Crash when clicking on items in subcategory

On Android, when I click on anything in the menu, I get this:
TypeError: TypeError: undefined is not a function (evaluating '_iterator[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"]()')

Tried this fix as suggested elsewhere, didn't fix it:

import MultiSelect from 'react-native-multiple-select';
import 'core-js/es6/map'
import 'core-js/es6/symbol'
import 'core-js/fn/symbol/iterator'

I'm just using the example with no changes and getting this problem.

Section selected when children was selected

Hello,
I have a weird issue.
When i select one specific children in the list , an other section parent was selected...
Anyway, why a parent section can be selected ?

I will try to investigate more.

Thanks.

Warning : Failed child context type: Invalid child context 'virtualizedCell.cellKey' of type 'number' supplied to 'CellRenderer', expected 'string'

keyExtractor={item => item[uniqueKey]}

replace this line for this one

   keyExtractor={item => item[uniqueKey].toString()}

keyExtractor={i => i[uniqueKey]}

and this one for this

 keyExtractor={i => i[uniqueKey].toString()}

Anyway not to need so many icons?

Anyway to make it to not need all of these icons. I have font awesome and that is enough for me but it won't run unless I also have MaterialIcons, etc.

Prop for custome display value

Is it possible to define which attribute is shown in the list.

Eg: A displayAttribute='title' prop

If not, do you accept a PR for this?

ios issue

In Android device it is working and displaying bell but in ios it is not displaying view.please help me

Select toggle hidden

2018-06-19 7 41 45

I can't see the select toggle button on iOS only, but Android is working well.
I think It seems like a flex issue.
Let me fix and gonna PR for it.

Reload Application does not close Modal

Seems like reloading of the app either in emulator mode or actual device does not close the modal. This occurs if the modal was already open prior to reloading app. The modal then becomes unresponsive and cannot be interacted with.

Anyone else having this problem?

Limit select item

Hi all,
How can i limit selection item. for example i want user can only select 5 item.
Many thanks.

Checkmark hidden

Hello,
With multiselect , if the text label is too long (or display several lines) the checkmark is hidden.

Thanks

There is a confusion if unique key of main item equal with unique key of sub items

If the data array is:
const items = [ { name: "Fruits", id: 0, children: [{ name: "Apple", id: 10, },{ name: "Strawberry", id: 17, },{ name: "Pineapple", id: 13, },{ name: "Banana", id: 14, },{ name: "Watermelon", id: 15, },{ name: "Kiwi fruit", id: 16, }] }, { name: "Gems", id: 1, children: [{ name: "Quartz", id: 1, },{ name: "Zircon", id: 21, },{ name: "Sapphire", id: 22, },{ name: "Topaz", id: 23, }] } ]

When we set the selectedItems array is [1] with readOnlyHeadings = true, it will check the Gems instead of Quartz. Please fix it. Thanks!

Own search callback prop

Hy!

I'd like to know if you're interested in this feature. If so, I could make a PR for it.

My plan is to add a new prop (eg.: findItem) as a callback function to be called instead of the built in find method.

_findItem = (id) => {
    const { items, findItem } = this.props
    return findItem ? findItem(id, items) : this.find(id, items)
}

The reason I need this, is because I need accent-insensitive search for county list.

selectedItemText Dont Work

Another styles work fine, but this dont work:

styles={{selectedItemText:{color:'red'}, another... }}

Help!

Default style isnt from gif examples?

I like the styles for this component as shown in the gifs... but they aren't the default!
Awesome component -- performance and customization is great. ๐Ÿฅ‡

Custom chips render

Hi @renrizzolo, great component and the infinite customization options.
I just want one more :) : a custom chips renderer, I want to render the chips to be uniform with my app: I use react-native-paper.

I also I want the chips to be above the "Select categories" element.

Thanks ๐Ÿ‘

Add search keyword if item doesn't exist

Hi,
Is there a way to add keywords if the given keyword can't be found from the item list.

For example when a user search specific item but no result found from the item list, there is a small add button to allow user to add and the modal will close.

After that the keyword will be added into the item list and a chip will be displayed for this keyword.

peer dep missing

Hi, when using your package, I get the below errors:
npm ERR! peer dep missing: [email protected], required by [email protected]
npm ERR! peer dep missing: react-native@^0.44.0, required by [email protected]

Should I downgrade my version of react-native to be able to use your package? Is there a reason why you have a dependency on react and react native in your package.json?

Thank you

Ajax Support

This is ones of the best packages I've seen. Is there anyway we can incorporate Ajax into it ?

callback function when modal is open or close

Is there a way to trigger a function when the modal is open or close ?
I need to programmatically update the keyboardShouldPersistTaps state for my parent ScrollView. It's because in my ScrollView I've other input, if I set my ScrollView keyboardShouldPersistTaps to "always" we won't be able to dismiss the keyboard when we tap on the screen.

Add option to always show selectText

I think the behaviour with selectText is a bit strange / specific.
When one item is selected, the name of that item is shown, instead of the selectText and when multiple are selected, than it is a combination of selectText, the amount of selected and the names of the selected items.

I would like the option to always show just the selectText independent of what is selected.

Error when pressing cancel after a long press

I'm getting an error when the cancel button is long pressed and sometimes it also throws this error on a short press as well. I've tried to find the source of the problem but can't seem to figure it out.

console.error: "Attempted to transition from state `RESPONDER_INACTIVE_PRESS_IN` to `RESPONDER_ACTIVE_LONG_PRESS_IN`, which is not supported. This is most likely due to `Touchable.longPressDelayTimeout` not being cancelled."
console.error
    YellowBox.js:59:8
Object._handleLongDelay
    Touchable.js:647:14
<unknown>
    JSTimers.js:255:17
_callTimer
    JSTimers.js:151:6
Object.callTimers
    JSTimers.js:404:6
MessageQueue.__callFunction
    MessageQueue.js:344:41
<unknown>
    MessageQueue.js:107:11
MessageQueue.__guard
    MessageQueue.js:291:8
MessageQueue.callFunctionReturnFlushedQueue
    MessageQueue.js:106:9

How to use "onSelectedItemObjectsChange"

Please guide me how to use onSelectedItemObjectsChange in sectioned multiselect for multiple item selection.

    <SectionedMultiSelect
          items={this.state.cat}
          uniqueKey='id'
          subKey='children'
          selectText='category'
          showDropDowns={true}
          selectChildren={true}
          readOnlyHeadings={true}
          onSelectedItemObjectsChange = {}
          selectedItems={this.state.category}
          removeAllText="Remove All"
          showRemoveAll={true}
      />

How to use **Styles** object and how can we open dropdowns by default when model opens

This is my select and styles object but it is not working...

 <SectionedMultiSelect
                      styles={{container: styles.container}}
                      colors={{primary: '#ef5350', text: '#ef5350', chipColor: '#ef5350'}}
                      items={items} 
                      uniqueKey='id'
                      subKey='children'
                      selectText='Type'
                      alwaysShowSelectText={true}
                      showDropDowns={true}
                      readOnlyHeadings={false}
                      selectChildren={true}
                      confirmText='Done'
                      onSelectedItemsChange={this.onSelectedItemsChange}
                      selectedItems={this.state.selectedItems}
                    />



const styles = StyleSheet.create({
  container: {
    backgroundColor: '#222', borderColor: '#CDCDCD', borderWidth: 1
  },
  chipContainer: {
    padding: 20,
    marginTop: 50
  }
});

react-native-sectioned-multi-select onSelectedItemsChange function save unique values only

I am new to react-native. Currently, i am working on react-native-sectioned-multi-select and i am having multiple sectioned-multi-select pickers. Now, what i want is on "onSelectedItemsChange" i am calling only one function called "onSelectedPublishersChange" for all multi-select pickers with respective "selectedItems" values. But, in all pickers values are almost same it means "A" is in first picker but "A" can be in third picker too and user can select from both the pickers.
But when we are saving values in "onSelectedPublishersChange" we need to check whether particular value is already there or not if it is not there then we will save it else we will continue with next value.
How can we do this?
My code snippet is below:

render()
{
  <SectionedMultiSelect
        items={this.state.selectedPublishers1}
        uniqueKey='id'
        subKey='children'
        selectText='Selected Publishers'
        showDropDowns={true}
        selectChildren={true}
        readOnlyHeadings={true}
        onSelectedItemsChange={this.onSelectedPublishersChange}
        selectedItems={this.state.selectedPublishers1}
        removeAllText="Remove All"
        showRemoveAll={true}
    />
    </View>
    <ScrollView keyboardShouldPersistTaps='always'>
        <View key={1} style={{width:320}}>
            <SectionedMultiSelect
                items={this.state.categories}
                uniqueKey='id'
                subKey='children'
                selectText='Publishers by category'
                showDropDowns={true}
                selectChildren={true}
                readOnlyHeadings={true}
                onSelectedItemsChange={this.onSelectedPublishersChange}
                selectedItems={this.state.publishersByCategory}
                removeAllText="Remove All"
                showRemoveAll={true}
            />
        </View>
        <View key={2}>
            <SectionedMultiSelect
                items={this.state.clients}
                uniqueKey='id'
                subKey='children'
                selectText='publishers by client'
                showDropDowns={true}
                readOnlyHeadings={true}
                onSelectedItemsChange={this.onSelectedPublishersChange}
                selectedItems={this.state.publishersByClient}
                removeAllText="Remove All"
                showRemoveAll={true}
            />
        </View>
        <View key={3}>
            <SectionedMultiSelect
                items={this.state.groups}
                uniqueKey='id'
                subKey='children'
                selectText='publishers by group'
                showDropDowns={true}
                readOnlyHeadings={true}
                onSelectedItemsChange={this.onSelectedPublishersChange}
                selectedItems={this.state.publishersByGroup}
                removeAllText="Remove All"
                showRemoveAll={true}
            />
          </View>
}
onSelectedPublishersChange = (selectedPublishersIds) => { 
    [HERE I NEED TO CHECK FOR UNIQUE VALUES]
    this.setState({selectedPublishers1});
}```

Prop to disable search

Hi there! First of all, thank you soooo much for this component, best modal dropdown so far!
Really glad that found it!

Would be cool if it would be possible to disable search as it's not always needed.

Thanks a lot!!

Missing selected value

Missing selected value on iOS only. Working fine on android.

import React from 'react';
import { StyleSheet, View } from 'react-native';
import SectionedMultiSelect from 'react-native-sectioned-multi-select';

export default class App extends React.Component {

  constructor() {
    super();
    this.state = {
      selectedItems: [],
    }
  }

  onSelectedItemsChange = (selectedItems) => {
    this.setState({ selectedItems });
  }

  render() {
    const items = [
      {
        name: "Fruits",
        id: '0',
        children: [{
          name: "Apple",
          id: '10',
        }, {
          name: "Strawberry",
          id: '17',
        }, {
          name: "Pineapple",
          id: '13',
        }, {
          name: "Banana",
          id: '14',
        }, {
          name: "Watermelon",
          id: '15',
        }, {
          name: "Kiwi fruit",
          id: '16',
        }]
      }];

    return (
      <View style={styles.container}>
        <SectionedMultiSelect
            items={items}
            uniqueKey='id'
            subKey='children'
            showDropDowns={false}
            readOnlyHeadings={true}
            onSelectedItemsChange={this.onSelectedItemsChange}
            selectedItems={this.state.selectedItems}
            showChips={false}
            single={true}      
          />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: 'white',
    alignItems: 'center',
    justifyContent: 'center',
  },
});

12jpg

Select all items in section

Hi,

Thanks very much for the package. Very useful! I was wondering if there was any way to give the option to select all items in a given section? For long lists, selecting items one by one could be cumbersome.

I checked the current props and you could add an extra property (say selectSubItems) to use in combination with readOnlyHeadings=false. If selectSubItems is true in combination with readOnlyHeadings=false, then selecting the parent item should cause all sub items to be selected as well.

In combination with that enhancement, I think it would be nice not to list all sub items within a given category when selecting an entire category. Instead, the category should be listed as would happen currently if using readOnlyHeadings=false or "All of CategoryName" to make it explicit.

Please let me know your thoughts.

Thanks

add keyboardShouldPersistTaps props

currently if we search and select the item, we've to tap twice.
first tap to dismiss the keyboard,
second tap to select the items.

Possible to add this props so that users can search and select right away ?

I've try to add this props in <modal> and <ScrollView> inside the <modal> it worked well.

Bug with confirmButton

I've found bug with confirm button when showCancelButton === false. I did solve it with adding style={{ flex: 1 }} for Touchable - container for View around cancel and confirm buttons, but I don't want fork library, because you are continuing to develop this component :)
image
With my styles it should be flex-stretched to window width

Empty Array

Empty Arrays leads to infinity loading component. This needs to have some props to handle "No data available".

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.