Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
react-responsive-select
Advanced tools
A customisable, touchable, React single-select / multi-select form control.
A customisable, touchable, React single-select / multi-select form control.
Built with keyboard and screen reader accessibility in mind.
This select component was created many years ago when there was no React WCAG select available. Now there are plenty. I suggest using one of those, their communities and contributer lists are larger. I will continue to run patches on this one in the foreseeable future for security upgrades if any issues arise.
Install the dependency - https://www.npmjs.com/package/react-responsive-select
npm install react-responsive-select --save-dev
Example usage (Single Select):
import React from 'react';
import { Select, CaretIcon, ModalCloseButton } from 'react-responsive-select';
// for default styles...
import 'react-responsive-select/dist/react-responsive-select.css';
const Form = () => (
<form>
<Select
name="carType1"
modalCloseButton={<ModalCloseButton />}
options={[
{ value: 'null', text: 'Any' },
{ value: 'alfa-romeo', text: 'Alfa Romeo' },
{ value: 'bmw', text: 'BMW' },
{ value: 'fiat', text: 'Fiat' },
{ value: 'subaru', text: 'Subaru' },
{ value: 'suzuki', text: 'Suzuki' },
{ value: 'tesla', text: 'Tesla' },
{ value: 'volvo', text: 'Volvo' },
{ value: 'zonda', text: 'Zonda' },
]}
caretIcon={<CaretIcon />}
prefix="Car1: "
selectedValue="subaru"
onChange={newValue => console.log('onChange', newValue)}
onSubmit={() => console.log('onSubmit')}
/>
</form>
);
Example usage (Multi Select):
import React from 'react';
import { Select, CaretIcon, MultiSelectOptionMarkup, ModalCloseButton } from 'react-responsive-select';
// for default styles...
import 'react-responsive-select/dist/react-responsive-select.css';
const Form = () => (
<form>
<Select
multiselect={true}
name="make6"
selectedValues={['fiat']}
modalCloseButton={<ModalCloseButton />}
options={[
{
value: 'any',
text: 'Any',
markup: <MultiSelectOptionMarkup text="Any" />,
},
{
value: 'fiat',
text: 'Fiat',
markup: <MultiSelectOptionMarkup text="Fiat" />,
},
{
value: 'subaru',
text: 'Subaru',
markup: <MultiSelectOptionMarkup text="Subaru" />,
},
{
value: 'suzuki',
text: 'Suzuki',
markup: <MultiSelectOptionMarkup text="Suzuki" />,
},
]}
caretIcon={<CaretIcon />}
onChange={(...rest) => console.log(rest)}
onSubmit={() => console.log('onSubmit')}
/>
</form>
);
https://benbowes.github.io/react-responsive-select/
https://benbowes.github.io/react-responsive-select/#/API
https://benbowes.github.io/react-responsive-select/#/Screen%20reader%20demo
Have a read of README_BUSINESS_RULES.md
From version 7.0.0 on, you will need to use a key
prop to update react-responsive-select's internal state. More on that here: https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html#recommendation-fully-uncontrolled-component-with-a-key
There are some examples in the recipe section here: https://benbowes.github.io/react-responsive-select/
FAQs
A customisable, touchable, React single-select / multi-select form control.
We found that react-responsive-select demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.