diff --git a/.gitignore b/.gitignore index e6b43584..b3dc0872 100644 --- a/.gitignore +++ b/.gitignore @@ -40,4 +40,5 @@ tsconfig.test.json .umi .dumi/tmp .dumi/tmp-test -.dumi/tmp-production \ No newline at end of file +.dumi/tmp-production +.history \ No newline at end of file diff --git a/README.md b/README.md index 55c589b0..9f744ef5 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,8 @@ export default () => ( | label | group label | String/React.Element | - | | key | - | String | - | | value | default filter by this attribute. if react want you to set key, then key is same as value, you can omit value | String | - | +| className | same as `Option props` | String | '' | +| title | same as `Option props`| String | - | ## Development diff --git a/docs/examples/optgroup.tsx b/docs/examples/optgroup.tsx index deef68b4..71783edb 100644 --- a/docs/examples/optgroup.tsx +++ b/docs/examples/optgroup.tsx @@ -18,8 +18,10 @@ const Test = () => ( onChange={onChange} options={[{ label: 'manager', + className: 'group-custom-className', + title:'group-custom-class', options: [ - { label: 'jack', value: 'jack' }, + { label: 'jack', value: 'jack', className:'jackClass1 jackClass2' , title:'jack-custom-Title' }, { label: 'lucy', value: 'lucy' } ], }, { diff --git a/src/OptionList.tsx b/src/OptionList.tsx index 9bb1a6c9..ec07eb67 100644 --- a/src/OptionList.tsx +++ b/src/OptionList.tsx @@ -319,7 +319,7 @@ const OptionList: React.ForwardRefRenderFunction = (_, r return (
{label !== undefined ? label : key} diff --git a/src/Select.tsx b/src/Select.tsx index b5c87c67..13edadd5 100644 --- a/src/Select.tsx +++ b/src/Select.tsx @@ -91,6 +91,8 @@ export interface FieldNames { export interface BaseOptionType { disabled?: boolean; + className?: string; + title?: string; [name: string]: any; }