Skip to content

Commit

Permalink
fix: include disabled item for searching tag item in options (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
picodoth committed Jun 20, 2018
1 parent 17f1097 commit e361f17
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Select.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,8 @@ class Select extends React.Component {
sel.push(menuItem);
menuItems.push(menuItem);
}
if (tags && !child.props.disabled) {

if (tags) {
childrenKeys.push(childValue);
}
});
Expand Down
10 changes: 10 additions & 0 deletions tests/Select.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,16 @@ describe('Select', () => {
expect(wrapper.find('li').text()).toEqual('1');
});

it('should include disabled item in options', () => {
const wrapper = mount(
<Select tags open value={['name1']}>
<Option key="name1" disabled>name1</Option>
<Option key="name2">name2</Option>
</Select>
);
expect(wrapper.find('li.rc-select-dropdown-menu-item')).toHaveLength(2);
});

it('renders not found when search result is empty', () => {
const wrapper = mount(
<Select open>
Expand Down

0 comments on commit e361f17

Please sign in to comment.