From f70b3a89f7e96d6a5bb0d4e208470dde6fc1f90e Mon Sep 17 00:00:00 2001 From: "a.shatalov" Date: Thu, 12 Oct 2017 12:59:55 +0300 Subject: [PATCH] added feature to select multiple, that allows show arrow --- src/PropTypes.js | 1 + src/Select.jsx | 2 +- tests/Select.multiple.spec.js | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/PropTypes.js b/src/PropTypes.js index ab944e6b..8eed40fe 100644 --- a/src/PropTypes.js +++ b/src/PropTypes.js @@ -50,6 +50,7 @@ export const SelectPropTypes = { className: PropTypes.string, prefixCls: PropTypes.string, multiple: PropTypes.bool, + multipleShowArrow: PropTypes.bool, filterTreeNode: PropTypes.any, showSearch: PropTypes.bool, disabled: PropTypes.bool, diff --git a/src/Select.jsx b/src/Select.jsx index 84767a98..7936bc02 100644 --- a/src/Select.jsx +++ b/src/Select.jsx @@ -944,7 +944,7 @@ class Select extends Component { {ctrlNode} {allowClear && this.state.value.length && this.state.value[0].value ? clear : null} - {multiple || !props.showArrow ? null : + {multiple && !props.multipleShowArrow || !props.showArrow ? null : ( { select(treeWrapper, 0); // unselect expect(wrapper.find('input').node.value).toBe(''); }); + + it('renders select multiple with arrow', () => { + const wrapper = render(createSelect({ multipleShowArrow: true })); + + expect(wrapper.find('.rc-tree-select-arrow')).toHaveLength(1); + }); });