diff --git a/src/Select.jsx b/src/Select.jsx index 1c85dd63d..21e3b5096 100644 --- a/src/Select.jsx +++ b/src/Select.jsx @@ -297,6 +297,7 @@ const Select = createClass({ onPlaceholderClick() { if (this.getInputDOMNode()) { this.getInputDOMNode().focus(); + this.props.onFocus(); } }, diff --git a/tests/Select.spec.js b/tests/Select.spec.js index 9a0cb757d..9a5d25b55 100644 --- a/tests/Select.spec.js +++ b/tests/Select.spec.js @@ -270,6 +270,18 @@ describe('Select', () => { it('set className', () => { expect(wrapper.find('.rc-select').node.className).toContain('-focus'); }); + + it('click placeholder should trigger onFocus', () => { + const handleFocus2 = jest.fn(); + const wrapper2 = mount( + + ); + wrapper2.find('.rc-select-selection__placeholder').simulate('click'); + expect(handleFocus2).toBeCalled(); + }); }); describe('blur', () => {