Skip to content

Commit

Permalink
Merge pull request #1392 from iviteb/feature/disable_unavail_select_o…
Browse files Browse the repository at this point in the history
…ptions_dropdown

Adding disabled attr to dropdown select options
  • Loading branch information
estacioneto authored Jun 16, 2021
2 parents f829919 + 9fcd776 commit 9dcf3bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- **Modal** sometimes not loading `window.scroll` polyfill after the browser hard refresh.

### Added

- **Dropdown** `disabled` prop added to options

## [9.142.0] - 2021-05-19

### Added
Expand Down
3 changes: 2 additions & 1 deletion react/components/Dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class Dropdown extends Component {
</option>
)}
{options.map(option => (
<option key={option.value} value={option.value}>
<option disabled={option.disabled} key={option.value} value={option.value}>
{option.label}
</option>
))}
Expand Down Expand Up @@ -290,6 +290,7 @@ Dropdown.propTypes = {
/** Dropdown options list */
options: PropTypes.arrayOf(
PropTypes.shape({
disabled: PropTypes.bool,
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
.isRequired,
label: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
Expand Down

1 comment on commit 9dcf3bd

@vercel
Copy link

@vercel vercel bot commented on 9dcf3bd Jun 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.