Skip to content

Commit 8e2205e

Browse files
committed
Updated release to v1.0.7 with Fix for ReactstrapSelectInput Label and added defaultOption prop
1 parent 5354717 commit 8e2205e

4 files changed

Lines changed: 17 additions & 9 deletions

File tree

dist/ReactstrapSelectInput.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
1+
function _objectWithoutProperties(obj, keys) {
2+
var target = {};
3+
for (var i in obj) {
4+
if (keys.indexOf(i) >= 0) continue;
5+
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
6+
target[i] = obj[i];
7+
}
8+
return target;
9+
}
210

311
import * as React from 'react';
4-
import { FormFeedback, FormGroup, Input, Label } from "reactstrap";
12+
import {FormFeedback, FormGroup, Input, Label} from "reactstrap";
513

614
/*let handleBlur = event => {
715
if (this.ignoreNextBlur === true) {
@@ -31,7 +39,7 @@ var ReactstrapSelectInput = function ReactstrapSelectInput(_ref) {
3139
React.createElement(
3240
Label,
3341
{ "for": field.name, className: "label-color" },
34-
props.inputprops.label
42+
props.label
3543
),
3644
React.createElement(
3745
Input,
@@ -40,7 +48,7 @@ var ReactstrapSelectInput = function ReactstrapSelectInput(_ref) {
4048
React.createElement(
4149
"option",
4250
{ value: "" },
43-
props.inputprops.label
51+
props.inputprops.defaultOption
4452
),
4553
props.inputprops.options.map(function (option, index) {
4654
if (option.name) return React.createElement(

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reactstrap-formik",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"dependencies": {
55
"bootstrap": "^4.1.3",
66
"formik": "^1.3.0",

src/components/ReactstrapSelectInput.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ const ReactstrapSelectInput = ({
2121
let touch = touched[field.name];
2222
return (
2323
<FormGroup>
24-
<Label for={field.name} className={"label-color"}>{props.inputprops.label}</Label>
24+
<Label for={field.name} className={"label-color"}>{props.label}</Label>
2525
<Input {...field} {...props} type="select" invalid={Boolean(touched[field.name] && errors[field.name])}
2626
placeholder="Test">
27-
<option value="">{props.inputprops.label}</option>
27+
<option value="">{props.inputprops.defaultOption}</option>
2828
{props.inputprops.options.map((option, index) => {
2929
if (option.name)
3030
return (<option value={option.id} key={index}>{option.name}</option>);

src/stories/SelectStory.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default () => (
3838
name: 'country',
3939
id: 'country',
4040
options: ['India', 'USA', 'UK', 'Saudi Arabia'],
41-
label: "Country"
41+
defaultOption: "Country"
4242
}}>
4343
</Field>
4444
</Col>
@@ -51,7 +51,7 @@ export default () => (
5151
name: 'country',
5252
id: 'country',
5353
options: ['India', 'USA', 'UK', 'Saudi Arabia'],
54-
label: "Country"
54+
defaultOption: "Country"
5555
}}>
5656
</Field>
5757
</Col>

0 commit comments

Comments
 (0)