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

[bug] table组件 onChange事件触发时自定义事件时使用this.setState({})导致排序一直处于descend状态 #12870

Closed
1 task
ghost opened this issue Oct 29, 2018 · 4 comments
Assignees

Comments

@ghost
Copy link

ghost commented Oct 29, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.10.3

Environment

win7 chrome react 16.5.2

Reproduction link

Edit on CodeSandbox

Steps to reproduce

见重现链接

What is expected?

可以随意改变排序order的值并可以使用setState

What is actually happening?

在onChange事件触发的中使用setState导致order一直为descend

@afc163
Copy link
Member

afc163 commented Oct 29, 2018

Your codesandbox don't contain any data.

@ghost
Copy link
Author

ghost commented Oct 29, 2018

请问你指的是没有什么数据?codesandbox 中没有代码还是table表格中没有数据?要是table表格没有数据的话,我已经添加了,而且这个问题和有没有数据没有关系吧,我只是想触发一下table的onChange事件。
你可以点击表头的排序功能它并不会切换上下箭头,但注释掉this.setState({})这行代码后就可以了
https://codesandbox.io/s/l7lwr3v56q

@afc163
Copy link
Member

afc163 commented Oct 29, 2018

https://codesandbox.io/s/m59p54k99y

将 columns 移出 render 就好了。

@afc163
Copy link
Member

afc163 commented Oct 29, 2018

#12737 (comment)

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

2 participants