Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hideDefaultSelections prevents first two custom selections from running #7626

Closed
duniul opened this issue Sep 15, 2017 · 2 comments
Closed

Comments

@duniul
Copy link

duniul commented Sep 15, 2017

Version

2.13.1

Environment

Windows 10, Chrome 60.0.3112.113

Reproduction link

https://codepen.io/anon/pen/NaqMom

Steps to reproduce

  1. Create a Table component with a rowSelection prop containing hideDefaultSelections: true and at least three custom selections.
  2. In the rendered table, try to click on the two first options in the row selection dropdown. Nothing happens. The other options will work as intended.

What is expected?

onSelect in rowSelections.selections[0] and rowSelections.selections[1] should fire when the corresponding option is clicked.

What is actually happening?

onSelect is not triggered for the first two options.


I have provided a Codepen-link for minimal reproduction, but the bug also happens in this example on the official page: https://ant.design/components/table/#components-table-demo-row-selection-custom

@infeng
Copy link
Contributor

infeng commented Sep 18, 2017

@benjycui Before add hideDefaultSelections selections of rowSelection add all and invert in the beginning, so custom selection start index is greater than 1. When hideDefaultSelections is true, the custom selection start index should be equal or greater than 0 😆.

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

No branches or pull requests

3 participants