Skip to content

Commit

Permalink
[Select] Fix some W3C issues (#11983)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Jun 26, 2018
1 parent cd47eea commit 91ecbbd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions docs/src/pages/customization/css-in-js/css-in-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion packages/material-ui/src/Input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,6 @@ class Input extends React.Component {
{startAdornment}
<InputComponent
aria-invalid={error}
aria-required={required}
autoComplete={autoComplete}
autoFocus={autoFocus}
className={inputClassName}
Expand Down
3 changes: 1 addition & 2 deletions packages/material-ui/src/RadioGroup/RadioGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,12 @@ class RadioGroup extends React.Component {

return (
<FormGroup role="radiogroup" {...other}>
{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) {
Expand Down
8 changes: 7 additions & 1 deletion packages/material-ui/src/Select/SelectInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ class SelectInput extends React.Component {
open: openProp,
readOnly,
renderValue,
required,
SelectDisplayProps,
tabIndex: tabIndexProp,
type = 'hidden',
Expand All @@ -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 = [];
Expand Down Expand Up @@ -283,7 +286,6 @@ class SelectInput extends React.Component {
<input
value={Array.isArray(value) ? value.join(',') : value}
name={name}
readOnly={readOnly}
ref={this.handleInputRef}
type={type}
{...other}
Expand Down Expand Up @@ -411,6 +413,10 @@ SelectInput.propTypes = {
* @returns {ReactElement}
*/
renderValue: PropTypes.func,
/**
* @ignore
*/
required: PropTypes.bool,
/**
* Properties applied to the clickable div element.
*/
Expand Down

0 comments on commit 91ecbbd

Please sign in to comment.