diff --git a/src/generate.tsx b/src/generate.tsx index f3da06c33..6acf99c70 100644 --- a/src/generate.tsx +++ b/src/generate.tsx @@ -280,6 +280,7 @@ export default function generateSelector< notFoundContent = 'Not Found', optionLabelProp, backfill, + tabIndex, getInputElement, getPopupContainer, diff --git a/tests/Multiple.test.tsx b/tests/Multiple.test.tsx index 12a31d5d9..2e2e784d9 100644 --- a/tests/Multiple.test.tsx +++ b/tests/Multiple.test.tsx @@ -443,4 +443,23 @@ describe('Select.Multiple', () => { expect(wrapper.find('Input').prop('editable')).toBeTruthy(); }); + + it('correctly handles the `tabIndex` prop', () => { + const wrapper = mount( + ); + expect( + wrapper + .find('.rc-select') + .getDOMNode() + .getAttribute('tabindex'), + ).toBeNull(); + + expect( + wrapper + .find('input.rc-select-selection-search-input') + .getDOMNode() + .getAttribute('tabindex'), + ).toBe('0'); + }); }); diff --git a/tests/Tags.test.tsx b/tests/Tags.test.tsx index caadf7c18..c95329fff 100644 --- a/tests/Tags.test.tsx +++ b/tests/Tags.test.tsx @@ -399,4 +399,21 @@ describe('Select.Tags', () => { expect(errSpy).not.toHaveBeenCalled(); errSpy.mockRestore(); }); + + it('correctly handles the `tabIndex` prop', () => { + const wrapper = mount(