Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ export interface SelectProps<ValueType = any, OptionType extends BaseOptionType
onChange?: (value: ValueType, option?: OptionType | OptionType[]) => void;
classNames?: Partial<Record<SemanticName, string>>;
styles?: Partial<Record<SemanticName, React.CSSProperties>>;

// >>> Accessibility
// https://github.com/ant-design/ant-design/issues/46030
// https://github.com/ant-design/ant-design/issues/53713
// https://github.com/ant-design/ant-design/pull/55185#discussion_r2389642896
role?: string;
Comment on lines +182 to +187

Choose a reason for hiding this comment

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

medium

While adding support for the role prop is a good accessibility improvement, explicitly adding it to the SelectProps interface appears to be redundant. The SelectProps interface inherits properties from BaseSelectProps, which in turn extends React.AriaAttributes. Since role is part of React.AriaAttributes, it should already be available on SelectProps through type inheritance.

To avoid redundancy and keep the interface definition cleaner, you can remove this explicit declaration. The functionality should remain the same.

}

function isRawValue(value: DraftValueType): value is RawValueType {
Expand Down
Loading