Skip to content

Commit b606279

Browse files
committed
chore: of it
1 parent 97bce99 commit b606279

File tree

4 files changed

+100
-396
lines changed

4 files changed

+100
-396
lines changed

src/SelectInput/Content/MultipleContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default React.forwardRef<HTMLInputElement, SharedContentProps>(function M
5050

5151
// ===================== Search ======================
5252
const inputValue = showSearch ? searchValue : '';
53-
const inputEditable: boolean = showSearch && (triggerOpen || focused);
53+
const inputEditable: boolean = showSearch && !disabled;
5454

5555
// Props from context with safe defaults
5656
const removeIcon: RenderNode = removeIconFromContext ?? '×';

tests/Multiple.test.tsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,6 @@ describe('Select.Multiple', () => {
507507
showSearch
508508
/>,
509509
);
510-
expect(container.querySelector('input')).toHaveAttribute('readOnly');
511-
512-
fireEvent.focus(container.querySelector('input'));
513510

514511
expect(container.querySelector('input')).not.toHaveAttribute('readOnly');
515512
});
@@ -518,25 +515,25 @@ describe('Select.Multiple', () => {
518515
const { container } = render(
519516
<Select mode="multiple" options={[{ value: 'bamboo' }, { value: 'light' }]} tabIndex={0} />,
520517
);
521-
expect(container.querySelector('.rc-select').getAttribute('tabindex')).toBeFalsy();
518+
expect(container.querySelector('.rc-select')).not.toHaveAttribute('tabindex');
522519

523-
expect(
524-
container.querySelector('input.rc-select-selection-search-input').getAttribute('tabindex'),
525-
).toBe('0');
520+
expect(container.querySelector('input')).toHaveAttribute('tabindex', '0');
526521
});
527522

528-
it('should render title defaultly', () => {
523+
it('should render title by default', () => {
529524
const { container } = render(
530525
<Select mode="multiple" options={[{ value: 'title' }]} value={['title']} />,
531526
);
532-
expect(container.querySelector('.rc-select-item').getAttribute('title')).toBe('title');
527+
expect(container.querySelector('.rc-select-selection-item').getAttribute('title')).toBe(
528+
'title',
529+
);
533530
});
534531

535-
it('should not render title defaultly when label is ReactNode', () => {
532+
it('should not render title by default when label is ReactNode', () => {
536533
const { container } = render(
537534
<Select mode="multiple" options={[{ value: '1', label: <div>label</div> }]} value={['1']} />,
538535
);
539-
expect(container.querySelector('.rc-select-item').getAttribute('title')).toBeFalsy();
536+
expect(container.querySelector('.rc-select-selection-item').getAttribute('title')).toBeFalsy();
540537
});
541538

542539
it('disabled should not show remove icon', () => {

0 commit comments

Comments
 (0)