aidurber / react-picky Goto Github PK
View Code? Open in Web Editor NEWYet another React multiselect. With checkbox support instead of tags.
License: MIT License
Yet another React multiselect. With checkbox support instead of tags.
License: MIT License
4.1.2 use with TypeScript
I have a problem with sellect all, default is checked even when pass to the value props empty array. After select one value is unchecked and work fine. But when i pass to the props array with all selected value in opstions sellect all is unchecked.
devDependency
enzyme was updated from 3.8.0
to 3.9.0
.devDependency
enzyme-adapter-react-16 was updated from 1.9.1
to 1.10.0
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
This monorepo update includes releases of one or more dependencies which all belong to the enzyme group definition.
enzyme is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
An additional prop, not sure on the name, maybe manyDisplayedPlaceholder
.
Not sure if a render prop or a sprintf style input like:
"You have selected %s"
The render prop would be called with the number of selected items.
Leaning towards the latter.
devDependency
react was updated from 16.6.1
to 16.6.2
.devDependency
react-dom was updated from 16.6.1
to 16.6.2
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
This monorepo update includes releases of one or more dependencies which all belong to the react group definition.
react is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Should support objects i.e.
[{id: 1, name: "Test"}, { id: 2, name: "Another One"}]
With support of supplying value and label props
<Picky valueKey="id" labelKey="name" ... />
Following the last issue i opened (#29) regarding the placeholder, there is some more strings that are hard-coded.
They are:
This way, everyone can use your component in whatever language they need, or using any strings they want.
1.5.1
I use a custom render for the list items, but now the select all item looks very out of place. Having a custom renderer prop for the select all button would help resolve this. This might also allow for including a "deselect all" button.
master
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can resolve this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
The npm token configured in the NPM_TOKEN
environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/
.
If you are using Two-Factor Authentication, make configure the auth-only
level is supported. semantic-release cannot publish with the default auth-and-writes
level.
Please make sure to set the NPM_TOKEN
environment variable in your CI with the exact value of the npm token.
Good luck with your project β¨
Your semantic-release bot π¦π
5.6.0
to 5.6.1
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
react-testing-library is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 1 commits.
8436c7e
fix(TS): typing of testHook (#292)
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Hi,
Would be very useful if we could pass a custom class for the component, for the sake to customize it using, for example, styled-component. Currently, it keeps only `.picky' class
import Picky from 'react-picky'
import styled from 'styled-components'
const Select = styled(Picky)`
background-color: grey
`
Currently, as I mentioned, className
is fixed
<div
ref={node => {
this.node = node;
}}
className="picky" />
It could be something like that:
className={[className, 'picky']}
Best regards
2.0.6+
Related to #68
Missing localisation for in-built terms.
Is it possible to set the item height as auto? I have diferent values coming from the DB and right now they are overlapping each other, since there is strings that contain only a few characters, and some that are more long.
Very good library btw :)
4.1.0
Seems like there is a synchronization issue where if the state is changed to select all values, the 'Select all' button (if enabled) is not checked.
See here to reproduce the bug:
https://codesandbox.io/s/9351z3moqr
1.5.1
dropdownHeight prop sets "height", not "max-height", so that few options results in extra dropdown space.
p.s. thanks for this!!! I had the exact same problem this is trying to solve. It's a great start, and I imagine it will become quite used. A couple more issues forthcoming...
1.2.3
When selecting options, before numberDisplayed
kicks in, it shows selected items in reverse order.
Should have basic sorting of labels.
1.4.1
Clicking the anywhere but the component should close the dropdown.
I want to add "Clear All" Option in list. But facing issue
renderList={({ items, selected, multiple, selectValue, getIsSelected }) =>
this.renderCustList(items, selected, multiple, selectValue, getIsSelected)
}
renderCustList(items, selected, multiple, selectValue, getIsSelected) {
let myarray = [];
myarray.push(
<li >
<strong>Clear All</strong>
</li>
)
items.map(item => (
myarray.push( <li key={item.id} onClick={() => selectValue(item)}>
{getIsSelected(item) ? <strong>{item.name}</strong> : item.name}
</li>
)
))
return myarray;
}
Issue: Its rendering as expected but When i select multiple value and unselect the values one by one. list is getting closed.
Ex: if i selected 4 items, and if i unselect any one item then the list is getting closed. again i have to open the list to unselect another item.
Expected: It should keep open the list until i click outside.
Can someone please help me on this.
Thanks,
Prabhu
I am using react-picky in loop and displaying multiple dropdowns using package, my requirement is i need custom data onChange of value so i can use it to make generic handleOnChange method. Please suggest how can i get custom data related to dropdown
Before the great refactor I want to migrate to TypeScript. The strongly typed-ness will come in handy.
I also don't want to keep maintaining the type definition file, (which I've already begun to neglect).
Not too difficult of a task. Just don't break the API.
I suggest making the search box selected by default if it is enabled. Click. Start searching.
Hello again Aidurber,
Why does the aria-owns attribute have a invalid value? Is there a reason for it to be empty? And if you have a aria-role attribute in the parent, you should have them on the childrens, according to a colleague of mine. Is there any way for us to fix this?
Regards,
AndrΓ© Bastos
Placing here for reference.
The component wasn't initially designed for use with virtual lists and render props. Which it should have. Due to this the code needs a refactor to better allow custom rendering.
One approach would be to make it a compound component with an API that might look like:
const options = [1, 2, 3, 4, 5];
<Picky options={options} value={2}>
<Picky.Button allSelectedText="All Selected" numberDisplayed={3} />
<Picky.Input placeholder="Filter..." />
<Picky.Menu>
{({item, isSelected})=>{
<Picky.Item text={item} />
//.. or custom rendering
<div>{item}</div>
}}
</Picky.Menu>
</Picky>
Allowing for flexible composition like:
<Picky options={options} value={2}>
<Picky.Menu dropUp={true}>
{({item, isSelected})=>{
<Picky.Item text={item} />
//.. or custom rendering
<div>{item}</div>
}}
</Picky.Menu>
<Picky.Button allSelectedText="All Selected" numberDisplayed={3} />
<Picky.Input placeholder="Filter..." />
</Picky>
The current API could still be supported by it using the above API internally.
Hello!
I've been playing around with certain ideas with the options and i was wondering if there is a way to disable certain options?
Thanks,
Karan Kumar
2.0.5
When you select the dropdown, type a search string on the filter and close the dropdown and open it again - the dropdown shows the filtered list with the filter input empty. The only way to get back to the original state (options) is to type in something and then manually delete it.
You can test it out in the sandbox: https://codesandbox.io/s/qq1689zk3q
Is there a way to access the this.state,filtered flag and set it to false on close of the dropdown list?
1.8.0
Passing an initial array of selected items shows the number selected items but the items aren't selected.
Users might not want a purely controlled component. If no value prop is provided then it's an uncontrolled component.
isControlled(){
return this.props.value != null
}
// ...
// Any reference to this.props.value, check if isControlled()
// if it is use .props.value else use state.selectedValue
I was trying to figure out how to limit the number of selections in the multiselect option. For example: if my total number of options are 6, but the user should not select more than 3.
Is it possible to make the number of selected items necessary to show the message "X selected numbers" dynamic? that is, having a prop that decides what that number should be?
3.0.2
Setting an array of objects as options
with a valueKey
to define wich key are the values and setting an array of value
doesnt work (none get checked)
There is a least a bug in :
isItemSelected(item) {
[...]
return hasItem(value, item, this.props.labelKey, this.props.valueKey);
}
because hasItem
has the 2 last arguments reversed (valueKey
THEN labelKey
):
export const hasItem = (all, item, valueKey, labelKey, returnIndex) => {
[...]
});
But setting valueKey
and labelKey
as the options' label and value
as an array of options' values doest work either, so there is also another bug somewhere.
Hello,
Your library does not work with IE11.
I traced the problem to the "includes" method that you use when verifying the placeholder props. IE11 does not recognize that method. Is it possible to swap to a polyfill alternative?
devDependency
enzyme was updated from 3.8.0
to 3.9.0
.devDependency
enzyme-adapter-react-16 was updated from 1.10.0
to 1.11.0
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
This monorepo update includes releases of one or more dependencies which all belong to the enzyme group definition.
enzyme is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
How can I pass the event object to the selectMultipleOption method, and not only the value selected?
4.1.2
Would like to control the css style of the button classname="picky__input" such as when the dropdown is opened, the background color is changed. Motivation: using Atlaskit and Reactstrap, but fall short for long dropdown lists (checkboxes), and need to use their style for the Picky component.
Possible solutions:
devDependency
enzyme was updated from 3.8.0
to 3.9.0
.devDependency
enzyme-adapter-react-16 was updated from 1.9.1
to 1.10.0
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
This monorepo update includes releases of one or more dependencies which all belong to the enzyme group definition.
enzyme is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Adding keyboard support should be easy enough to implement.
Should use correct aria and roles.
2.05.
<Picky
value={this.state.selectedModel}
onChange={this.handleModel}
multiple={true}
=> Select one value in picky
=> Update the state from outside function and assign the empty value. i.e, selectedModel = [];
=> Select another value in picky
=> See, Instead of one value is selected its getting two values selected
1.4.1
It doesn't make sense to keep a single select open when selected a value.
Should add new prop "keepOpen" which will keep the dropdown open on selecting a value.
1.9.1
Whatever multi-select I add the select all checkbox comes checked by default. I'm not sure if it is a bug or I'm doing something wrong. The example below illustrate the issue.
import React from 'react'
import Picky from 'react-picky'
class Select extends React.Component {
constructor (props) {
super(props)
this.state = {
selected: null
}
}
render () {
return (
<Picky
multiple
numberDisplayed={1}
includeSelectAll
includeFilter
value={value}
onChange={onChange}
options={options}
valueKey='value'
labelKey='label'
placeholder='Selecionar'
selectAllText='Tudo'
/>
)
}
}
2.0.5
In MutiSelect, When I Click on any of checkbox it is hitting onChange two times. Due to this if I write an API calling in onChange method then it is firing two times. Instead of clicking on checkbox if I click on lable in <li> then it is working fine.
1.3.2
With a list of 100,000 items, the selectAll method could be much faster. No need for unneccessary map of options.
allSelected check does a sort too which slows things down considerably.
Did some basic performance.now checks.
allSelected check down from ~44ms to ~0.3ms
4.1.1
Initial state: There are 2 items in the list and select-all-checkbox, all the items are selected and select-all-checkbox is checked.
At selecting/unselecting the second (last) item, the select-all-checkbox works correctly.
I tried in the sandbox https://codesandbox.io/s/mmpq6z7lr8
with slice(0, 2) in the getCountries().
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.