Skip to content

Conversation

@zhengshuai1001
Copy link
Contributor

添加 api 以在完成级联选择时更改弹窗的可见性

弹窗默认在选中最后一级后自动关闭。这一逻辑导致级联选择不能实现多选的功能。

想增加一个api: popupVisibleAfterSelect,如果为true,handleChange 后不会默认关闭。点击弹窗之外依然会关闭。

点击最后一级后自动关闭示意图:
动画

README.md Outdated
<td>specific the default loading icon</td>
</tr>
<tr>
<td>popupVisibleAfterSelect</td>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<td>popupVisibleAfterSelect</td>
<td>hidePopupOnSelect</td>

@afc163
Copy link
Member

afc163 commented Jul 12, 2021

来一些测试用例。

@zhengshuai1001
Copy link
Contributor Author

来一些测试用例。

加了

.hasClass('rc-cascader-menu-item-active'),
).toBe(true);

expect(wrapper.state().popupVisible).toBeTruthy();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

开启 hidePopupOnSelect 后,还是可以 blur 隐藏的吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以的

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

补充一个用例?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好,稍等

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加了

@codecov
Copy link

codecov bot commented Jul 13, 2021

Codecov Report

Merging #176 (8da725d) into master (4edd066) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 8da725d differs from pull request most recent head 8921029. Consider uploading reports for the commit 8921029 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master     #176   +/-   ##
=======================================
  Coverage   92.96%   92.96%           
=======================================
  Files           4        4           
  Lines         270      270           
  Branches       94       94           
=======================================
  Hits          251      251           
  Misses         19       19           
Impacted Files Coverage Δ
src/Cascader.tsx 94.44% <100.00%> (ø)

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 4edd066...8921029. Read the comment docs.

@afc163 afc163 merged commit 33000cb into react-component:master Jul 13, 2021
@afc163
Copy link
Member

afc163 commented Jul 13, 2021

@zombieJ zombieJ mentioned this pull request Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants