Closed axelboc closed 1 year ago
When closing a multi-select, onOpenChange(open) is called twice: first with open=true and then again with open=false.
onOpenChange(open)
open=true
open=false
To replicate the issue, paste this code in the JSX tab of the first multi-select demo and open the console:
// MultiSelect = require("react-selectize").MultiSelect Form = React.createClass({ // render :: a -> ReactElement render: function(){ var self = this, options = ["apple", "mango", "grapes", "melon", "strawberry"].map(function(fruit){ return {label: fruit, value: fruit} }); return <MultiSelect options = {options} placeholder = "Select fruits" onOpenChange = {function (open) {console.log(open);}}></MultiSelect> } }); render(<Form/>, mountNode)
Console output:
true should only be printed once, when the drop-down is opened, which is the case with SimpleSelect.
true
SimpleSelect
When closing a multi-select,
onOpenChange(open)
is called twice: first withopen=true
and then again withopen=false
.To replicate the issue, paste this code in the JSX tab of the first multi-select demo and open the console:
Console output:
true
should only be printed once, when the drop-down is opened, which is the case withSimpleSelect
.