Closed tnke closed 1 year ago
The onChange callback of SortablePostsControl incorrectly returns a function when sorting, because of these lines: https://github.com/evermade/wp-block-toolkit/blob/main/src/components/SortablePostsControl.js#L191-L196
onChange
The current method works fine when using e.g. useState, but not when using setAttributes of WP. The component should always predictably return the array of sorted values.
useState
setAttributes
The
onChange
callback of SortablePostsControl incorrectly returns a function when sorting, because of these lines: https://github.com/evermade/wp-block-toolkit/blob/main/src/components/SortablePostsControl.js#L191-L196The current method works fine when using e.g.
useState
, but not when usingsetAttributes
of WP. The component should always predictably return the array of sorted values.