Giter VIP home page Giter VIP logo

react-bootstrap-multiselect's Introduction

react-bootstrap-multiselect

NPM version Dependency Status devDependency Status

Description

A multiselect component for react (with bootstrap). This is a react wrapper around an existing jQuery/bootstrap library (it is not a pure react port):

bootstrap-multiselect

Getting Started

  1. Install the module with: npm install --save react-bootstrap-multiselect

  2. Create your module (you need to use something like browserify to build)

var React = require('react');
var Multiselect = require('react-bootstrap-multiselect');
var someReactComponent = React.createClass({
    render: function () {
        return (
            <Multiselect />
        );
    }
});
  1. Include the multi-select CSS in your project somewhere. The CSS file is here: bootstrap-multiselect.css (don't hotlink- download and host your own copy)
<link rel="stylesheet" href="bootstrap-multiselect.css" type="text/css" />

Supported React Versions

Note on data synchronization

In case this.state.myData changes from outside of multiselect component, values and checkbox state will not update automatically. If you want to sync state, you have to call .syncData() on multiselect like in example below.

var React = require('react');
var Multiselect = require('react-bootstrap-multiselect');

var someReactComponent = React.createClass({
    getInitialState: function(){
        var that = this;
        $("element").on("event", function(){
            $.get("new-data-from-url", function(newData){
                that.setState(newData);

                // to sync manually do
                that.refs.myRef.syncData();
            });
        });

        return {
            myData : [{value:'One',selected:true},{value:'Two'}]
        };
    },
    render: function () {
        return (
            <Multiselect onChange={this.handleChange} ref="myRef" data={this.state.myData} multiple />
        );
    }
});

Documentation

For in depth documentation, see the original bootstrap-multiselect project page.

Links

Similar React Components

License

Copyright (c) 2014 skratchdot
Uses the original bootstrap-multiselect license.

react-bootstrap-multiselect's People

Contributors

angelaigreja avatar audiolion avatar boatkorachal avatar lvgunst avatar mfrye-intuit avatar netsgnut avatar raghavio avatar rkhayat avatar rosselliott avatar skratchdot avatar sman591 avatar thataustin avatar tomaskikutis avatar wuwb 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  avatar  avatar

react-bootstrap-multiselect's Issues

Component loaded as having all boxes selected and checked

Is there a way of accomplishing this?

For instance, when the component is loaded, I want all the checkboxes to already be checked and I want all of them to be selected. I tried using JQuery with this but I'm not entirely sure which class or property to be changing.

Thanks!

Require 'bootstrap-dropdown' causes conflict

If I link bootstrap.min.js in my app(which I must do because I need other functionalities in bootstrap), this multiselect dropdown button DOESN'T work.

See http://stackoverflow.com/questions/35378368/bootstrap-sass-multiselect-event-conflict

It would be better to remove the require of 'bootstrap-dropdown' in this module and let the user link bootstrap.min.js instead:

if (typeof window !== 'undefined' && typeof document !== 'undefined') {
  //Necessary for Universal Javascript apps
  //since JQuery requires a working window
  var $ = require('./bootstrap-multiselect.js').init(
    require('./bootstrap-dropdown.js').init(
      require('jquery')
    )
  );
}

Failed updating react-bootstra-multiselect because of unmet react dependency

I've React dependency in my package.json:

"react": "^0.14.7"

When I try to update react-bootstrap-multiselect I get unmet dependecy on React:

├── UNMET DEPENDENCY react@^0.14.7
└─┬ [email protected]
  └── [email protected]

In your package.json you are using dependencies

"dependencies": {
  "jquery": ">=2.1.x",
  "react": ">=0.14.x"
},

React 0.14.7 should be valid for >=0.14.x but it doesn't look te be working.

When I run npm ls react I get:

├── UNMET DEPENDENCY react@^0.14.7
├─┬ [email protected]
│ └── [email protected]
└─┬ [email protected]
  └── [email protected]

npm ERR! missing: react@^0.14.7, required by [email protected]

Im using NPM 3 which uses a flat node_modules directory. After updating to [email protected] my node_modules/react-bootstrap-multiselect directory has it's own node_modules directory. My own node_modules/react has been removed.

node_modules/react-bootstrap-multiselect

When I try to build my application I get "Module not found: Error: Cannot resolve module 'react'". It won't use react from node_modules/react-bootstrap-multiselect/node_modules.

Im also using your react-bootstrap-daterangepicker which has the same dependencies but it's using peerDependecies for jquery and react. https://github.com/skratchdot/react-bootstrap-daterangepicker/blob/master/package.json#L22-L25

Do you know this problem and do you know if changing dependencies to peerDependencies in your module will fix this? Im happy to create a pull request.

Node v5.1.1
NPM 3.3.12

Is there a way to get data for Options via API call?

I am trying to integrate API call in filter search box.
So when user types in filter search box to search for option via filter box. It does an API call and than data is update. Hence option list is update. If any one has already integrated than please share.

`templates` options not honoured?

get-options.js seems to be a whitelist for the react-bootstrap-multiselect to know which properties to pass to the underlying bootstrap-multiselect library. However it does not have a templates on list, which means the templates cannot be customized.

I have tried to add "templates" manually to the aforementioned file and it works. Maybe we should update the gulp script for that? Thanks.

Page scrolls when list reaches end

Hello,

I am using react-bootstrap-multiselect in several spots, and I have noticed that (even when the mouse is still inside the component) the scroll event propagates to body, causing it to scroll, when you've reached the end of the list.

IS this something I can apply? Or does it need a fork. I'm thinking it should go something like this...
Check if mouse is on component, Capture Scroll event, React based on mouse position

Upon inspection, I think this can be handled without the need to change any of the source code, since I have a wrapping DIV for the components.
Thanks.

Reloading options based on events

React calls render() when the state of the component changes. If a component uses this Multiselect widget and repaints itself when the web server responds with options for the dropdown, this multiselect does not repaint itself. The alternative is to implement the React component's componentDidMount() and call $.multiselect("dataprovider", options) inside it. This is straying from react's principles. Is this a known bug?

React v15.5 createClass() deprecation

React v15.5 is removing createClass() in favor of native es6 classes, is there any opposition to a PR to update react-bootstrap-multiselect to use es6 classes?

Invariant Violation: MultiSelect.render(): A valid ReactComponent must be returned.

My project uses React 0.13.3. I added the following:

return (<Multiselect />);

I am getting the following error:

Invariant Violation: MultiSelect.render(): A valid ReactComponent must be returned. You may have returned undefined, an array or some other invalid object

I guess it is an issue due to my older react version. Does your component work with React 0.13?

Cannot create a simple MultiSelect tag

Code in a render method:

<MultiSelect multiple />

Error:

Uncaught [object Object]invariant @ invariant.js:46instantiateReactComponent @ instantiateReactComponent.js:64instantiateChild @ ReactChildReconciler.js:29traverseAllChildrenImpl @ traverseAllChildren.js:98traverseAllChildrenImpl @ traverseAllChildren.js:114traverseAllChildren @ traverseAllChildren.js:186ReactChildReconciler.instantiateChildren @ ReactChildReconciler.js:52ReactMultiChild.Mixin._reconcilerInstantiateChildren @ ReactMultiChild.js:197ReactMultiChild.Mixin.mountChildren @ ReactMultiChild.js:232ReactDOMComponent.Mixin._createContentMarkup @ ReactDOMComponent.js:591ReactDOMComponent.Mixin.mountComponent @ ReactDOMComponent.js:479ReactReconciler.mountComponent @ ReactReconciler.js:37ReactMultiChild.Mixin.mountChildren @ ReactMultiChild.js:241ReactDOMComponent.Mixin._createContentMarkup @ ReactDOMComponent.js:591ReactDOMComponent.Mixin.mountComponent @ ReactDOMComponent.js:479ReactReconciler.mountComponent @ ReactReconciler.js:37ReactMultiChild.Mixin.mountChildren @ ReactMultiChild.js:241ReactDOMComponent.Mixin._createContentMarkup @ ReactDOMComponent.js:591ReactDOMComponent.Mixin.mountComponent @ ReactDOMComponent.js:479ReactReconciler.mountComponent @ ReactReconciler.js:37ReactMultiChild.Mixin.mountChildren @ ReactMultiChild.js:241ReactDOMComponent.Mixin._createContentMarkup @ ReactDOMComponent.js:591ReactDOMComponent.Mixin.mountComponent @ ReactDOMComponent.js:479ReactReconciler.mountComponent @ ReactReconciler.js:37ReactCompositeComponentMixin.mountComponent @ ReactCompositeComponent.js:225wrapper @ ReactPerf.js:66ReactReconciler.mountComponent @ ReactReconciler.js:37ReactCompositeComponentMixin.mountComponent @ ReactCompositeComponent.js:225wrapper @ ReactPerf.js:66ReactReconciler.mountComponent @ ReactReconciler.js:37ReactMultiChild.Mixin.mountChildren @ ReactMultiChild.js:241ReactDOMComponent.Mixin._createContentMarkup @ ReactDOMComponent.js:591ReactDOMComponent.Mixin.mountComponent @ ReactDOMComponent.js:479ReactReconciler.mountComponent @ ReactReconciler.js:37ReactCompositeComponentMixin.mountComponent @ ReactCompositeComponent.js:225wrapper @ ReactPerf.js:66ReactReconciler.mountComponent @ ReactReconciler.js:37ReactCompositeComponentMixin.mountComponent @ ReactCompositeComponent.js:225wrapper @ ReactPerf.js:66ReactReconciler.mountComponent @ ReactReconciler.js:37ReactCompositeComponentMixin.mountComponent @ ReactCompositeComponent.js:225wrapper @ ReactPerf.js:66ReactReconciler.mountComponent @ ReactReconciler.js:37ReactCompositeComponentMixin.mountComponent @ ReactCompositeComponent.js:225wrapper @ ReactPerf.js:66ReactReconciler.mountComponent @ ReactReconciler.js:37mountComponentIntoNode @ ReactMount.js:266Mixin.perform @ Transaction.js:136batchedMountComponentIntoNode @ ReactMount.js:282Mixin.perform @ Transaction.js:136ReactDefaultBatchingStrategy.batchedUpdates @ ReactDefaultBatchingStrategy.js:62batchedUpdates @ ReactUpdates.js:94ReactMount._renderNewRootComponent @ ReactMount.js:476wrapper @ ReactPerf.js:66ReactMount._renderSubtreeIntoContainer @ ReactMount.js:550ReactMount.render @ ReactMount.js:570wrapper @ ReactPerf.js:66window.ReactRailsUJS.mountComponents @ react_ujs.self-06684ab54101bce1b455802d71af1f7157c37b116c4b0c40b3c3b3dd8aee150d.js?body=1:59(anonymous function) @ react_ujs.self-06684ab54101bce1b455802d71af1f7157c37b116c4b0c40b3c3b3dd8aee150d.js?body=1:108j @ jquery.min.self-92bfaaece1eee1e40fd3b55441ee536e7f6a03242aa5fe10e2597a27103c9dae.js?body=1:3k.fireWith @ jquery.min.self-92bfaaece1eee1e40fd3b55441ee536e7f6a03242aa5fe10e2597a27103c9dae.js?body=1:3n.extend.ready @ jquery.min.self-92bfaaece1eee1e40fd3b55441ee536e7f6a03242aa5fe10e2597a27103c9dae.js?body=1:3I @ jquery.min.self-92bfaaece1eee1e40fd3b55441ee536e7f6a03242aa5fe10e2597a27103c9dae.js?body=1:3
backend.js:8441 Uncaught TypeError: Cannot read property 'props' of undefinedgetData @ backend.js:8441walkNode @ backend.js:8348(anonymous function) @ backend.js:8351walkNode @ backend.js:8350(anonymous function) @ backend.js:8351walkNode @ backend.js:8350(anonymous function) @ backend.js:8351walkNode @ backend.js:8350(anonymous function) @ backend.js:8351walkNode @ backend.js:8350(anonymous function) @ backend.js:8351walkNode @ backend.js:8350(anonymous function) @ backend.js:8351walkNode @ backend.js:8350(anonymous function) @ backend.js:8351walkNode @ backend.js:8350(anonymous function) @ backend.js:8351walkNode @ backend.js:8350(anonymous function) @ backend.js:8351walkNode @ backend.js:8350(anonymous function) @ backend.js:8351walkNode @ backend.js:8350(anonymous function) @ backend.js:8351walkNode @ backend.js:8350walkRoots @ backend.js:8342extras.walkTree @ backend.js:8315(anonymous function) @ backend.js:8075(anonymous function) @ VM51589:44emit @ VM51589:43setupBackend @ backend.js:8152module.exports @ backend.js:8096(anonymous function) @ backend.js:113g @ backend.js:1964EventEmitter.emit @ backend.js:1877(anonymous function) @ backend.js:297(anonymous function) @ backend.js:1024(anonymous function) @ backend.js:1023_handleMessage @ backend.js:1016listener @ backend.js:91

Getting error elem.cloneNode is not a function

Firstly, thanks a lot for writing this React wrapper around bootstrap multiselect. It works like a charm!
However, I got error initially and it was not rendering at all due to a line in your index.js code:
$this.$multiselect = $($this.refs.multiselect);

I was getting an error from jquery saying that elem.cloneNode is not a function, because it wasn't able to access the actual DOM of the select tag. So I modified that line in my project to this:
$this.$multiselect = $(React.findDOMNode($this.refs.multiselect));

Then it worked perfectly.

how to set default selected in list

var data = [{value:1,label:'a'},{value:2,label:'b'}]
var tableList = [ {value:1,title:'t1'},{value:2,title:'t2'} ]

tableList.map((item, index){
// how to set Multiselect default selected by item.value

})

Filter text clears on state change

To replicate:

  1. Create a multiselect with filter
  2. Add a setState on onChange
  3. Run
  4. Write something on the filter box
  5. Click an item
    Expected: multiselect should still be filtered
    What happens: filter is cleared and multiselect lists all items

I'm guessing since the setState forces a render of the component, the filter box is back to default empty state.

Tried a work around stated in the bootstrap-multiselect site:
http://davidstutz.de/bootstrap-multiselect/#further-examples

$('#file-box-wrapper li.multiselect-filter input').val(this.filterKeyword).trigger('keydown');

text is placed in the filterbox but it does not update the list.

problem on the first example

i get this meesage :
/react-bootstrap-multiselect/lib/bootstrap-dropdown.js:2
[2] if (typeof jQuery.fn.dropdown !== "undefined") return jQuery;
when i write var Multiselect = require('react-bootstrap-multiselect');
what can be the problem?

Few options don't work

buttonText - Uncaught TypeError: this.options.buttonText is not a function
maxHeight / buttonWidth seem to be ignored.

The onSelectAll event is firing even if the user manually selects all options

In the original control that I believe this one is based on, the documentation says that onSelectAll won't be fired if the user selects all options manually. Only if the user clicks the "All" checkbox.

http://davidstutz.github.io/bootstrap-multiselect/#configuration-options-onSelectAll

In this control, the event does fire. This makes it really hard to manage the select all event, because when I populate the control with selected values on load, it fires the event, making react rerender and repopulate the values (causing an infinite loop).

I might be doing something wrong, but it was noteworthy to me that the davidstutz version apparently behaves differently.

This control is awesome. Thanks for making it.

Mocha Testing

When I try to test the npm module react-bootstrap-multiselect with mocha and enzyme, I get the following error:

if (typeof jQuery.fn.dropdown !=="undefined" return jQuery;
TypeError: Cannot read property 'dropdown' of undefined
this error happens in \react-bootstrap-multiselect\lib\bootstrap-dropdown. My code up to the point of error is:

import React from 'react';
import { mount } from 'enzyme';
import { expect } from 'chai';
import jsdom from 'jsdom';

const doc = jsdom.jsdom('<!doctype html><html><body></body></html>')
global.document = doc
global.window = doc.defaultView
global.$ = global.jQuery = require('jquery')(global.window);

import MasterTable from '../components/masterTable';

where the error is thrown when I try to import MasterTable. MasterTable tries to render the react-bootstrap-multiselect.

Link to StackOverflow post http://stackoverflow.com/questions/40406149/testing-react-bootstrap-multiselect-with-mocha

Inconsistent behavior with groups

Is this behavior expected? When I select two options from separate groups the button still only shows one selection. Also, I can't select multiple groups (in their entirety)-- the max number of selected options is always 4. Any ideas?

dropdownbehavior

Bad title on multiselect element hover

title-bug

Title is formed like this

options.each(function () {
  selected += $(this).text() + ', ';
});

The problems is, that select options don't have innerHtml to form title from

<option value="1" label="Option 1"></option>

Selects are rendered by render function in index.js

render: function () {
        //this.setOptionsFromProps();
        return React.createElement('select',
            React.__spread({}, this.props, {ref: 'multiselect'}));
    }

I think label should be duplicated as innerHtml in every option in order for this functionality not to break.

'templates' option not working

Hello,

Adding the templates option seems to cause the multiselect not to render, is there something with my code or is the feature not included in the wrap?

templates= {function(){
    return({
           templates: {
                button: '<button type="button" class="multiselect dropdown-toggle" data-toggle="dropdown"></button>',
                ul: '<ul class="multiselect-container dropdown-menu"></ul>',
                filter: '<li class="multiselect-item filter"><div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span><input class="form-control multiselect-search" type="text"></div></li>',
                filterClearBtn: '<span class="input-group-btn"><button class="btn btn-default multiselect-clear-filter" type="button"><i class="glyphicon glyphicon-remove-circle"></i></button></span>',
                li: '<li><a href="javascript:void(0);"><label></label></a></li>',
                divider: '<li class="multiselect-item divider"></li>',
                liGroup: '<li class="multiselect-item group"><label class="multiselect-group"></label></li>'
            }
        });
    }}

Clickable optgroups (possibly) broken in 0.6.0

I wasn't able to pinpoint what exactly causes this, but clickable optgroups (enableClickableOptGroups prop) behavior seems to have changed for the worse between 0.5.0 and 0.6.0. It seems that in 0.6.0, clicking a group label only triggers the onChange handler for the first child in the group. In 0.5.0, the handler is triggered for all children. At first I suspected that maybe the API had changed, and the onChange handler would now get all the values in one call, but that doesn't seem to be the case.

Was something changed on purpose and I'm just doing things wrong now or is this a bug?

Several issues

  • When using options, they work well, but React renders this error in the console: warning.js:45Warning: Unknown props 'enableFiltering', 'enableCaseInsensitiveFiltering', 'includeSelectAllOption' on [select] tag. Remove these props from the element. For details, see https://fb.me/react-unknown-prop
  • There is something missing in the "documentation". It is required to import 'react-bootstrap' and load the 'react-bootstrap.min.js' file. With the normal 'bootstrap' NPM package it doesn't work. The dropdown will not open.
  • When using 'react-bootstrap' there's an error in the console: PanelGroup.js:10
    Uncaught TypeError: Cannot read property 'PropTypes' of undefined

enableFiltering not wokring

I can't manage to enable the filtering feature with my Multiselect react component.

Here is the code

 <Multiselect
                data={[{value:'My',selected:true},{value:'fake'},{value:'data'},{value:'is'},{value:'foobar'}]}
                includeSelectAllOption={true}
                [...]
                enableFiltering={true}
                [...]
                buttonClass='btn btn-whatever'
                multiple/>

Am I doing something wrong ?

selecting multiple values (having same value key) but from different group not appear as different

groups = [
{label:'Group One',children:[{value:'1'},{value:'2'},{value:'3'}]},
{label:'Group Two',children:[{value:'2'},{value:'2'},{value:'3'}]}
]

onChange giving same index for each 1,2,3 either of Group One or of Group Two i.e 0,1,2 respectively

 handleChange = (option, select) => {
    console.log("() : ", option[0].index);
    console.log("() : ", option.val());
  };

and also when we select multiple values (same) but different group, then it not shows on button label and nor it gives those selected value from this.refs.view.refs.multiselect.selectedOptions

How to test multiselect dropdown on change event?

Hi,
I am writing testcases using enzyme, mocha and chai. When I call onChange event for multiselect it is not firing call.

Here is my code:

First one

 it('change country selection', () => {
     const wrapper = mount(<SearchFormPanel {...props}/>)
     const onCountryChange = spy(wrapper.instance(), 'onCountryChange')
     wrapper.instance().forceUpdate()
     wrapper.find('input[type="checkbox"]')
     expect(onCountryChange).to.have.calledOnce
     expect(wrapper.state('selectedCountries')).to.contain('GB')
     onCountryChange.restore() 
 })

Second one

 it('change country selection', () => {
    const wrapper = mount(<SearchFormPanel {...props}/>)
    const onCountryChange = spy(wrapper.instance(), 'onCountryChange')
    wrapper.instance().forceUpdate()
    let checkboxNode = $($(wrapper.getDOMNode()).find('input[type="checkbox"]')[3])
    checkboxNode.prop('checked', true).change()
    expect(onCountryChange).to.have.calledOnce
    expect(wrapper.state('selectedCountries')).to.contain('GB')
    onCountryChange.restore()
 })

Is there any better way to find onChange event?

`multiple` option generates 2 `ul`s in the dom

The Problem

I found today that when I use the multiple option, the bootstrap-multiselect generates two uls for the dropdown of options, with the second being populated by the selectable options.

image

It would seem that with Bootstrap v3 this is not an issue as both of these uls are shown at the same time (the empty one just appears as 2px of borders and is unnoticeable).

However if you are using Bootstrap v4, the new dropdown they have implemented only applies styles to the first child ul instead of both - meaning that the second ul containing the options is not shown/visible.

image

The little border there is the empty dropdown list.

Some Details

We use a modified source of this plugin to work around the bootstrap/jQuery requirement (I think this is mentioned in #73 if it matters) so I started off by checking that it is not our changes causing the issue.

It didn't appear to be in our changes so I checked the demo page for this plugin and you can see the issue by inspecting the dom on the multiple select dropdowns (example attached).

image

I then went and checked that this issue is not from the parent bootstrap-multiselect plugin and can confirm that their multiple examples on the demo page do not exhibit this problem.

Fixing it

In the in index.js and in the componentDidMount() function; there is a call on line 80 to $this.$multiselect.multiselect($this.getOptionsFromProps()); directly followed by a second call to $this.setOptionsFromProps();.

It would seem that the second call there is then building another dropdown list with no items in it.

If we comment out line 81 (the $this.setOptionsFromProps();) then the extra ul disappears - the plugin also seems to continue to work fine without this line.

Questions

  1. Is there any harm in commenting out this line? We're unsure if it affects/breaks anything else we are unaware of.
  2. Is this a change that should be added to this repo?

Thanks for you time, keep up the awesome work! 👍

Select all option throws issue?

When click selectAll option it throws error in console and not updated the button text.

Uncaught TypeError: this.options.onSelectAll is not a function at Multiselect.selectAll (bootstrap-multiselect.js:1358) at Multiselect.<anonymous> (bootstrap-multiselect.js:590) at HTMLInputElement.f (jquery-2.1.3.min.js:2) at HTMLInputElement.dispatch (jquery-2.1.3.min.js:3) at HTMLInputElement.r.handle (jquery-2.1.3.min.js:3)

React >0.14.0 Warnings: .getDOMNode()

Warning: ReactDOMComponent: Do not access .getDOMNode() of a DOM node; instead, use the node directly. This DOM node was rendered by MultiSelect.

The problem is on line 46 of index.js:
$this.$multiselect = $($this.refs.multiselect.getDOMNode());
In React >0.14.0 the dom node is direct in ref, so below should be fixed:
$this.$multiselect = $($this.refs.multiselect);

Select options do not appear, multiselect is grayed out

I'm using React 15.5, and have Bootstrap 4 included in the project.

My code:

<Dropdown
	onChange={event => {
		this.setState({
			yearFilter: this.value(this.refs.yieldYears)
		});
	}}
	ref="yieldYears"
	data={[
		{ value: 'average', selected: true },
		{ value: 2017, label: '2017' },
		{ value: 2018, label: '2018' }
	]}
	multiple
/>

My element appears like this:

image

When I inspect the element, the HTML looks fine:

`
average 2017 2018

average
    • average
    • 2017
    • 2018
    `

    buttonClass Prop ignored

    buttonClass doesn't seem to do anything.

    buttonClass='btn btn-danger'
    

    I set the following as a prop but it doesn't work.

    Selected items don't update after setState

    In demo code there is handleChange function, which updates first select(labeled "no optgroups"), with new values after any select changes.

    handleChange: function () {
            this.setState({
                list: [{value:'One'},{value:'Two'},{value:'Three'},{value:'Four',label:'Four Label'}]
            });
        },
    

    If it worked correctly, no values should be selected in first select after first change of any select, but old values stay and state is not being re-rendered.

    Cannot resolve 'bootstrap' on dev builds

    Using a basic webpack configuration for building a project, i ran the following:
    npm install react-bootstrap-multiselect

    inside my entry point I have only one line:
    import 'react-bootstrap-multiselect';

    When building with webpack, I'm getting the following error:
    Module not found: Error: Can't resolve 'bootstrap' in 'node_modules/react-bootstrap-multiselect/dist'

    installed version for react-bootstrap-multiselect: 2.4.1

    If I follow these exact steps when installing 2.2.0 specifically - everything works fine.
    This was found as a regression in an existing project.

    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.