From 19264de53b59272c96684dc9b313242e7af6e4a6 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Tue, 26 Jun 2018 19:02:59 +0200 Subject: [PATCH] [Select] Fix some W3C issues (#11983) --- docs/src/pages/customization/css-in-js/css-in-js.md | 2 ++ packages/material-ui/src/Input/Input.js | 1 - packages/material-ui/src/RadioGroup/RadioGroup.js | 3 +-- packages/material-ui/src/Select/SelectInput.js | 8 +++++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/src/pages/customization/css-in-js/css-in-js.md b/docs/src/pages/customization/css-in-js/css-in-js.md index 3dedb793a91a96..194416adae1bd9 100644 --- a/docs/src/pages/customization/css-in-js/css-in-js.md +++ b/docs/src/pages/customization/css-in-js/css-in-js.md @@ -387,6 +387,8 @@ const Styled = createStyled(theme => ({ })); ``` +[@jedwards1211](https://github.com/jedwards1211) Has taken the time to move this module into a package: [material-ui-render-props-styles](https://github.com/jcoreio/material-ui-render-props-styles). Feel free to use it. + ### styled-components API (+15 lines) styled-components's API removes the mapping between components and styles. Using components as a low-level styling construct can be simpler. diff --git a/packages/material-ui/src/Input/Input.js b/packages/material-ui/src/Input/Input.js index 6483dd5665e129..bf11e28cc5bd21 100644 --- a/packages/material-ui/src/Input/Input.js +++ b/packages/material-ui/src/Input/Input.js @@ -473,7 +473,6 @@ class Input extends React.Component { {startAdornment} - {React.Children.map(children, (child, index) => { + {React.Children.map(children, child => { if (!React.isValidElement(child)) { return null; } return React.cloneElement(child, { - key: index, name, inputRef: node => { if (node) { diff --git a/packages/material-ui/src/Select/SelectInput.js b/packages/material-ui/src/Select/SelectInput.js index 6e77209b236d24..1af641ce6509bf 100644 --- a/packages/material-ui/src/Select/SelectInput.js +++ b/packages/material-ui/src/Select/SelectInput.js @@ -178,6 +178,7 @@ class SelectInput extends React.Component { open: openProp, readOnly, renderValue, + required, SelectDisplayProps, tabIndex: tabIndexProp, type = 'hidden', @@ -186,6 +187,8 @@ class SelectInput extends React.Component { } = this.props; const open = this.isOpenControlled && this.displayNode ? openProp : this.state.open; + delete other['aria-invalid']; + let display; let displaySingle = ''; const displayMultiple = []; @@ -283,7 +286,6 @@ class SelectInput extends React.Component {