Skip to content

Commit b779f6f

Browse files
authored
Merge pull request #1411 from inplayer-org/add/disabled-option-in-dropdown
Add/disabled option in dropdown
2 parents f165162 + 434f465 commit b779f6f

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
# [2.5.28] - 29.09.2022
6+
7+
## Added
8+
9+
- Add `disabled` for Dropdown options
510
# [2.5.27] - 04.08.2022
611

712
## Added

index.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ export declare class DatePicker extends Component<DatePickerProps, DatePickerSta
514514
export interface Option extends AnalyticsProps {
515515
value: string;
516516
displayName: string;
517+
disabled?: boolean;
517518
}
518519

519520
export interface DefaultOption extends AnalyticsProps {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@inplayer-org/inplayer-ui",
33
"sideEffects": false,
4-
"version": "2.5.27",
4+
"version": "2.5.28",
55
"author": "InPlayer",
66
"description": "InPlayer React UI Components",
77
"main": "dist/inplayer-ui.cjs.js",

src/components/Dropdown/Dropdown.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
export type Option = {
1212
value: string;
1313
displayName: string;
14+
disabled?: boolean;
1415
} & AnalyticsProps;
1516

1617
type DefaultOption = {
@@ -87,8 +88,8 @@ const Dropdown: React.FC<Props> = ({
8788
{defaultOption.displayName}
8889
</option>
8990
)}
90-
{options.map(({ value, displayName }) => (
91-
<option value={value} key={value}>
91+
{options.map(({ value, displayName, disabled = false }) => (
92+
<option disabled={disabled} value={value} key={value}>
9293
{displayName}
9394
</option>
9495
))}

0 commit comments

Comments
 (0)