Skip to content

Commit 829de65

Browse files
committed
fix: option tag should also be valueOnly
Fixes remarkablemark#625
1 parent d7ba9d7 commit 829de65

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/attributes-to-props.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ var utilities = require('./utilities');
1010
module.exports = function attributesToProps(attributes) {
1111
attributes = attributes || {};
1212

13-
var valueOnlyInputs = {
13+
var valueOnlyTypes = {
1414
reset: true,
15-
submit: true
15+
submit: true,
16+
option: true
1617
};
1718

1819
var attributeName;
@@ -21,7 +22,7 @@ module.exports = function attributesToProps(attributes) {
2122
var propName;
2223
var propertyInfo;
2324
var props = {};
24-
var inputIsValueOnly = attributes.type && valueOnlyInputs[attributes.type];
25+
var typeIsValueOnly = attributes.type && valueOnlyTypes[attributes.type];
2526

2627
for (attributeName in attributes) {
2728
attributeValue = attributes[attributeName];
@@ -43,7 +44,7 @@ module.exports = function attributesToProps(attributes) {
4344
// https://reactjs.org/docs/uncontrolled-components.html
4445
if (
4546
(propName === 'checked' || propName === 'value') &&
46-
!inputIsValueOnly
47+
!typeIsValueOnly
4748
) {
4849
propName = getPropName('default' + attributeNameLowerCased);
4950
}

0 commit comments

Comments
 (0)