Skip to content

Commit

Permalink
fix(selector): makes component as uncontrolled component
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Stanislawski authored and redox committed Nov 5, 2015
1 parent 68adc0d commit 1dda12a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/Selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class Selector extends React.Component {
return (
<select
className={this.props.cssClasses.root}
defaultValue={currentValue}
onChange={handleChange}
value={currentValue}
>
{options.map((option) => {
return <option className={this.props.cssClasses.item} key={option.value} value={option.value}>{option.label}</option>;
Expand Down
4 changes: 2 additions & 2 deletions components/__tests__/Selector-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ describe('Selector', () => {
expect(out).toEqualJSX(
<select
className="custom-root"
defaultValue="index-a"
onChange={() => {}}
value="index-a"
>
<option className="custom-item" value="index-a">Index A</option>
<option className="custom-item" value="index-b">Index B</option>
Expand All @@ -50,8 +50,8 @@ describe('Selector', () => {
expect(out).toEqualJSX(
<select
className="custom-root"
defaultValue={10}
onChange={() => {}}
value={10}
>
<option className="custom-item" value={10}>10 results per page</option>
<option className="custom-item" value={20}>20 results per page</option>
Expand Down

0 comments on commit 1dda12a

Please sign in to comment.