Skip to content

Commit

Permalink
Disable select when only one domain exiists (#29873)
Browse files Browse the repository at this point in the history
  • Loading branch information
belcherj authored Jan 3, 2019
1 parent 12c38a5 commit f890d85
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ class DomainsSelect extends React.Component {
}

render() {
const { isRequestingSiteDomains, onChange, onFocus, value } = this.props;
const { domains, isRequestingSiteDomains, onChange, onFocus, value } = this.props;

return (
<select
value={ value }
onChange={ onChange }
onFocus={ onFocus }
disabled={ isRequestingSiteDomains }
disabled={ isRequestingSiteDomains || 1 === domains.length }
>
{ isRequestingSiteDomains && this.renderLoadingState() }
{ ! isRequestingSiteDomains && this.renderDomainSelect() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports[`DomainSelect it renders DomainsSelect loading state correctly 1`] = `

exports[`DomainSelect it renders DomainsSelect with one domain correctly 1`] = `
<select
disabled={false}
disabled={true}
onChange={[Function]}
onFocus={[Function]}
value="foo"
Expand Down
6 changes: 6 additions & 0 deletions client/my-sites/domains/domain-management/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,12 @@ ul.email-forwarding__list {
margin-left: -1px;
}
}

select:disabled {
background: none;
cursor: default;
padding-right: 14px;
}
}

.name-servers__dns {
Expand Down

0 comments on commit f890d85

Please sign in to comment.