select icon indicating copy to clipboard operation
select copied to clipboard

Improve behaviour on blur

Open rolftimmermans opened this issue 7 years ago • 3 comments

I'm using something similar to the following code. This is one of the examples from https://ant.design/components/select/

<Select
    showSearch
    style={{ width: 200 }}
    placeholder="Select a person"
    optionFilterProp="children"
    onChange={handleChange}
    onFocus={handleFocus}
    onBlur={handleBlur}
    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
  >
    <Option value="jack">Jack</Option>
    <Option value="lucy">Lucy</Option>
    <Option value="tom">Tom</Option>
  </Select>

When typing "jack" and then pressing TAB, the dropdown box briefly expands just before closing again.

select-issue-2

This patch fixes that behaviour by setting the open state to closed just before firing the change, instead of afterwards.

rolftimmermans avatar Dec 20 '17 17:12 rolftimmermans

Codecov Report

Merging #255 into master will increase coverage by <.01%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #255      +/-   ##
==========================================
+ Coverage   98.95%   98.95%   +<.01%     
==========================================
  Files           8        8              
  Lines         287      288       +1     
  Branches       81       82       +1     
==========================================
+ Hits          284      285       +1     
  Misses          3        3
Impacted Files Coverage Δ
src/Select.jsx 100% <ø> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update dade915...69890f4. Read the comment docs.

codecov-io avatar Dec 20 '17 17:12 codecov-io

Thanks, I'v tried fix this behavior too, but can't reproduce it in test, can you write a test?

yesmeck avatar Dec 22 '17 03:12 yesmeck

@rolftimmermans

afc163 avatar Apr 28 '18 15:04 afc163