Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
Adds empty onBlur to Select binding
Browse files Browse the repository at this point in the history
  • Loading branch information
headzoo committed Mar 1, 2018
1 parent 563f06f commit 686b86a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ charset = utf-8
end_of_line = lf
insert_final_newline = true

[*.{js,css,scss,less,coffee,yml,json}]
[*.{js,jsx,css,scss,less,coffee,yml,json}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
16 changes: 11 additions & 5 deletions src/bindings/redux-form/Select.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Field, fieldPropTypes } from 'redux-form';
import {Field, fieldPropTypes} from 'redux-form';
import * as Forms from 'Components/Forms';
import FieldGroup from './FieldGroup';

Expand All @@ -9,9 +9,14 @@ import FieldGroup from './FieldGroup';
*
* @see https://redux-form.com/7.0.4/docs/api/field.md/#2-a-stateless-function
*/
export const SelectField = ({ options, input, ...props }) => (
export const SelectField = ({options, input, ...props}) => (
<FieldGroup {...props}>
<Forms.Select {...input} options={options} />
<Forms.Select
{...input}
options={options}
onBlur={() => {
}}
/>
</FieldGroup>
);

Expand All @@ -29,7 +34,7 @@ SelectField.propTypes = {
/**
* Connects the field to the Redux store.
*/
const Select = ({ parse, ...props }) => {
const Select = ({parse, ...props}) => {
// Redux Form expects values to be strings, but the value of Forms.Select
// is an object with { label: string, value: string }. Parse the value to
// return the value part of the object unless the parse prop has already
Expand Down Expand Up @@ -66,7 +71,8 @@ Select.propTypes = {

Select.defaultProps = {
parse: undefined,
onChange: () => {}
onChange: () => {
}
};

export default Select;

0 comments on commit 686b86a

Please sign in to comment.