GriddleGriddle / Griddle

Simple Grid Component written in React
http://griddlegriddle.github.io/Griddle/
MIT License
2.5k stars 377 forks source link

onSort with *correct* sortProperties #749

Closed dahlbyk closed 6 years ago

dahlbyk commented 7 years ago

Griddle major version

1.x

Changes proposed in this pull request

onSort is now fired just before the new sortProperties are dispatched.

This essentially renders TableHeadingCell obsolete, but deleting it is a potentially breaking change.

Idea

What if events were fired from a Redux middleware instead of click handlers?

Why these changes are made

Close #716; #717 was insufficient.

Are there tests?

Existing story now demonstrates expected behavior.

It seems like a new React version changed behavior when render() returns a string, so the TS story has been adjusted.

dahlbyk commented 7 years ago

On re-review I noticed a few gaps between core and local versions of TableHeadingCellContainer, so I've added a commit to close the gap (mostly from #699).