diff --git a/src/FilterMixin.js b/src/FilterMixin.js
index 4f038aab7..4d667dbbe 100644
--- a/src/FilterMixin.js
+++ b/src/FilterMixin.js
@@ -13,14 +13,21 @@ export default {
if (!input) {
return true;
}
- const filterOption = ('filterOption' in this.props) ?
- this.props.filterOption : defaultFilter;
- if (!filterOption) {
+ let filterFn = this.props.filterOption;
+ if ('filterOption' in this.props) {
+ if (this.props.filterOption === true) {
+ filterFn = defaultFilter;
+ }
+ } else {
+ filterFn = defaultFilter;
+ }
+
+ if (!filterFn) {
return true;
} else if (child.props.disabled) {
return false;
- } else if (typeof filterOption === 'function') {
- return filterOption.call(this, input, child);
+ } else if (typeof filterFn === 'function') {
+ return filterFn.call(this, input, child);
}
return true;
},
diff --git a/tests/FilterMixin.spec.js b/tests/FilterMixin.spec.js
index af6667922..e6ddf82ec 100644
--- a/tests/FilterMixin.spec.js
+++ b/tests/FilterMixin.spec.js
@@ -125,6 +125,17 @@ describe('FilterMixin', () => {
expect(wrapper).toMatchSnapshot();
});
+ it('does not filter when filterOption value is false', () => {
+ const wrapper = render(
+
+ );
+
+ expect(wrapper).toMatchSnapshot();
+ });
+
describe('tag mode', () => {
it('renders unlisted item in value', () => {
const wrapper = render(
@@ -137,7 +148,7 @@ describe('FilterMixin', () => {
expect(wrapper).toMatchSnapshot();
});
- it('renders search value when not fount', () => {
+ it('renders search value when not found', () => {
const wrapper = render(