html-react-parser 1.4.4 → 1.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1324,12 +1324,18 @@
|
|
|
1324
1324
|
var attributesToProps$2 = function attributesToProps(attributes) {
|
|
1325
1325
|
attributes = attributes || {};
|
|
1326
1326
|
|
|
1327
|
+
var valueOnlyInputs = {
|
|
1328
|
+
reset: true,
|
|
1329
|
+
submit: true
|
|
1330
|
+
};
|
|
1331
|
+
|
|
1327
1332
|
var attributeName;
|
|
1328
1333
|
var attributeNameLowerCased;
|
|
1329
1334
|
var attributeValue;
|
|
1330
1335
|
var propName;
|
|
1331
1336
|
var propertyInfo;
|
|
1332
1337
|
var props = {};
|
|
1338
|
+
var inputIsValueOnly = attributes.type && valueOnlyInputs[attributes.type];
|
|
1333
1339
|
|
|
1334
1340
|
for (attributeName in attributes) {
|
|
1335
1341
|
attributeValue = attributes[attributeName];
|
|
@@ -1349,7 +1355,10 @@
|
|
|
1349
1355
|
|
|
1350
1356
|
// convert attribute to uncontrolled component prop (e.g., `value` to `defaultValue`)
|
|
1351
1357
|
// https://reactjs.org/docs/uncontrolled-components.html
|
|
1352
|
-
if (
|
|
1358
|
+
if (
|
|
1359
|
+
(propName === 'checked' || propName === 'value') &&
|
|
1360
|
+
!inputIsValueOnly
|
|
1361
|
+
) {
|
|
1353
1362
|
propName = getPropName('default' + attributeNameLowerCased);
|
|
1354
1363
|
}
|
|
1355
1364
|
|
|
@@ -2426,6 +2435,11 @@
|
|
|
2426
2435
|
var attributesToProps = attributesToProps$2;
|
|
2427
2436
|
var htmlToDOM = htmlToDom;
|
|
2428
2437
|
|
|
2438
|
+
// support backwards compatibility for ES Module
|
|
2439
|
+
htmlToDOM =
|
|
2440
|
+
/* istanbul ignore next */
|
|
2441
|
+
typeof htmlToDOM.default === 'function' ? htmlToDOM.default : htmlToDOM;
|
|
2442
|
+
|
|
2429
2443
|
var domParserOptions = { lowerCaseAttributeNames: false };
|
|
2430
2444
|
|
|
2431
2445
|
/**
|