Skip to content

Commit 5843447

Browse files
author
Edward Xiao
committed
- fix default ID problem.
1 parent c19b914 commit 5843447

15 files changed

+35
-17
lines changed

lib/components/Checkbox.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ var reactInputsValidationCss = {
7171
};
7272
var TYPE = 'checkbox';
7373

74+
var DEFAULT_ID = _utils["default"].getRandomId();
75+
7476
var getDefaultValidationOption = function getDefaultValidationOption(obj) {
7577
var name = obj.name,
7678
check = obj.check,
@@ -118,7 +120,7 @@ var component = function component(_ref) {
118120
var _ref$tabIndex = _ref.tabIndex,
119121
tabIndex = _ref$tabIndex === void 0 ? null : _ref$tabIndex,
120122
_ref$id = _ref.id,
121-
id = _ref$id === void 0 ? _utils["default"].getRandomId() : _ref$id,
123+
id = _ref$id === void 0 ? DEFAULT_ID : _ref$id,
122124
_ref$name = _ref.name,
123125
name = _ref$name === void 0 ? '' : _ref$name,
124126
_ref$value = _ref.value,

lib/components/Radiobox.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ var reactInputsValidationCss = {
7171
};
7272
var TYPE = 'radiobox';
7373

74+
var DEFAULT_ID = _utils["default"].getRandomId();
75+
7476
var getDefaultValidationOption = function getDefaultValidationOption(obj) {
7577
var name = obj.name,
7678
check = obj.check,
@@ -135,7 +137,7 @@ var component = function component(_ref) {
135137
var _ref$tabIndex = _ref.tabIndex,
136138
tabIndex = _ref$tabIndex === void 0 ? null : _ref$tabIndex,
137139
_ref$id = _ref.id,
138-
id = _ref$id === void 0 ? _utils["default"].getRandomId() : _ref$id,
140+
id = _ref$id === void 0 ? DEFAULT_ID : _ref$id,
139141
_ref$name = _ref.name,
140142
name = _ref$name === void 0 ? '' : _ref$name,
141143
_ref$value = _ref.value,

lib/components/Select.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,11 @@ var reactInputsValidationCss = {
7878
"select__dropdown-icon-container": "react-inputs-validation__select__dropdown-icon-container___2ild-"
7979
};
8080
var TYPE = 'select';
81+
82+
var DEFAULT_ID = _utils["default"].getRandomId();
8183
/* istanbul ignore next */
8284

85+
8386
if (!String.prototype.startsWith) {
8487
String.prototype.startsWith = function (searchString, position) {
8588
var p = position || 0;
@@ -187,7 +190,7 @@ var component = function component(_ref) {
187190
var _ref$tabIndex = _ref.tabIndex,
188191
tabIndex = _ref$tabIndex === void 0 ? null : _ref$tabIndex,
189192
_ref$id = _ref.id,
190-
id = _ref$id === void 0 ? _utils["default"].getRandomId() : _ref$id,
193+
id = _ref$id === void 0 ? DEFAULT_ID : _ref$id,
191194
_ref$name = _ref.name,
192195
name = _ref$name === void 0 ? '' : _ref$name,
193196
_ref$value = _ref.value,

lib/components/Textarea.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ var reactInputsValidationCss = {
7878
"select__dropdown-icon-container": "react-inputs-validation__select__dropdown-icon-container___2ild-"
7979
};
8080
var TYPE = 'textarea';
81+
82+
var DEFAULT_ID = _utils["default"].getRandomId();
83+
8184
var VALIDATE_OPTION_TYPE_LIST = ['string'];
8285
var DEFAULT_MAX_LENGTH = 524288; // Default value is 524288
8386

@@ -153,7 +156,7 @@ var component = function component(_ref) {
153156
var _ref$tabIndex = _ref.tabIndex,
154157
tabIndex = _ref$tabIndex === void 0 ? null : _ref$tabIndex,
155158
_ref$id = _ref.id,
156-
id = _ref$id === void 0 ? _utils["default"].getRandomId() : _ref$id,
159+
id = _ref$id === void 0 ? DEFAULT_ID : _ref$id,
157160
_ref$name = _ref.name,
158161
name = _ref$name === void 0 ? '' : _ref$name,
159162
_ref$value = _ref.value,

lib/components/Textbox.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ var reactInputsValidationCss = {
7878
"select__dropdown-icon-container": "react-inputs-validation__select__dropdown-icon-container___2ild-"
7979
};
8080
var TYPE = 'textbox';
81+
82+
var DEFAULT_ID = _utils["default"].getRandomId();
83+
8184
var VALIDATE_OPTION_TYPE_LIST = ['string', 'number'];
8285
var VALIDATE_NUMBER_TYPE_LIST = ['decimal', 'int'];
8386
var DEFAULT_MAX_LENGTH = 524288; // Default value is 524288
@@ -187,7 +190,7 @@ var component = function component(_ref) {
187190
var _ref$tabIndex = _ref.tabIndex,
188191
tabIndex = _ref$tabIndex === void 0 ? null : _ref$tabIndex,
189192
_ref$id = _ref.id,
190-
id = _ref$id === void 0 ? _utils["default"].getRandomId() : _ref$id,
193+
id = _ref$id === void 0 ? DEFAULT_ID : _ref$id,
191194
_ref$name = _ref.name,
192195
name = _ref$name === void 0 ? '' : _ref$name,
193196
_ref$type = _ref.type,

lib/react-inputs-validation.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/react-inputs-validation.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/react-inputs-validation.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/react-inputs-validation.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-inputs-validation",
3-
"version": "3.2.5",
3+
"version": "3.2.6",
44
"description": "React form input validation components",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)