react-dropdown-aria
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -123,3 +123,3 @@ 'use strict'; | ||
const optionItemStyle = (props, state, selected) => ({ | ||
const optionItemStyle = (props, state, { selected = false }) => ({ | ||
fontSize: '0.95em', | ||
@@ -126,0 +126,0 @@ overflow: 'hidden', |
@@ -123,3 +123,3 @@ 'use strict'; | ||
const optionItemStyle = (props, state, selected) => ({ | ||
const optionItemStyle = (props, state, { selected = false }) => ({ | ||
fontSize: '0.95em', | ||
@@ -126,0 +126,0 @@ overflow: 'hidden', |
{ | ||
"name": "react-dropdown-aria", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Simple and accessible React dropdown component", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -82,3 +82,3 @@ [![CircleCI](https://circleci.com/gh/jfangrad/react-dropdown-aria.svg?style=svg&circle-token=c8db79d70dddf853273a5964b860ec0bf53f5163)](https://circleci.com/gh/jfangrad/react-dropdown-aria/tree/master) [![npm](https://img.shields.io/npm/v/react-dropdown-aria.svg)](https://www.npmjs.com/package/react-dropdown-aria) | ||
const style = { | ||
optionItem: (base, state, selected) => ({ | ||
optionItem: (base, state, { selected }) => ({ | ||
...base, | ||
@@ -98,3 +98,3 @@ fontSize: '0.95em', | ||
``` | ||
As shown above, each function will be called with `base` and `state` at minimum and some will be provided a third `extraState` parameter as shown with `optionStyle` where the extraState is whether it is currently selected or not. | ||
As shown above, each function will be called with `base` and `state` at minimum and some will be provided a third `extraState` parameter which should be an object, as shown with `optionStyle` where the extraState contains is whether it is currently selected or not. | ||
@@ -101,0 +101,0 @@ `base` - is the default styles object. It can either be spread out to extend the default styles (as shown above) or ommitted to ignore all default styles |
46099