Skip to content
Merged
Show file tree
Hide file tree
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: 5 additions & 1 deletion examples/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default () => {
<div>
<h1>Value: {value ? value.format('YYYY-MM-DD HH:mm:ss') : 'null'}</h1>

<div style={{ display: 'flex' }}>
<div style={{ display: 'flex', flexWrap: 'wrap' }}>
<div style={{ margin: '0 8px' }}>
<h3>Basic</h3>
<Picker<Moment> {...sharedProps} locale={zhCN} />
Expand Down Expand Up @@ -121,6 +121,10 @@ export default () => {
<h3>Year</h3>
<Picker<Moment> {...sharedProps} locale={zhCN} picker="year" />
</div>
<div style={{ margin: '0 8px' }}>
<h3>Keyboard navigation (Tab key) disabled</h3>
<Picker<Moment> {...sharedProps} locale={enUS} tabIndex={-1} />
</div>
</div>
</div>
);
Expand Down
3 changes: 3 additions & 0 deletions src/Picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export interface PickerSharedProps<DateType> extends React.AriaAttributes {
allowClear?: boolean;
autoFocus?: boolean;
disabled?: boolean;
tabIndex?: number;
open?: boolean;
defaultOpen?: boolean;
/** Make input readOnly to avoid popup keyboard in mobile */
Expand Down Expand Up @@ -129,6 +130,7 @@ function InnerPicker<DateType>(props: PickerProps<DateType>) {
const {
prefixCls = 'rc-picker',
id,
tabIndex,
style,
className,
dropdownClassName,
Expand Down Expand Up @@ -466,6 +468,7 @@ function InnerPicker<DateType>(props: PickerProps<DateType>) {
<div className={`${prefixCls}-input`} ref={inputDivRef}>
<input
id={id}
tabIndex={tabIndex}
disabled={disabled}
readOnly={inputReadOnly || !typing}
value={text}
Expand Down