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
Dseekers opened this Issue Oct 29, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@Dseekers

Dseekers 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

This comment has been minimized.

Member

afc163 commented Oct 29, 2018

Your codesandbox don't contain any data.

@Dseekers

This comment has been minimized.

Dseekers commented Oct 29, 2018

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

@afc163

This comment has been minimized.

Member

afc163 commented Oct 29, 2018

https://codesandbox.io/s/m59p54k99y

将 columns 移出 render 就好了。

@afc163

This comment has been minimized.

Member

afc163 commented Oct 29, 2018

@afc163 afc163 closed this Oct 29, 2018

afc163 added a commit that referenced this issue Nov 1, 2018

Fix sort order broken issue when columns were put in render
will handle these situation

- with 'key'
- with function has same stringify value

close #12870
close #12737
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment