Ensure draggable placeholder has same column structure as dragged item.#15
Conversation
Copies the column structure of the dragged item, empties all the cell content and uses that as the placeholder to ensure the table structure is preserved. Signed-off-by: Ben Huson <ben@thewhiteroom.net>
|
@benhuson Thanks for the PR! I tested this out and while it works well, it can be simplified a bit. The placeholder we are setting here is the string that jQuery UI uses for the blank space showing where you are about to drop the item you are dragging. By default this is constructed from the dragged element and this is what your code fixes. A simpler more solid/safer fix is just clearing the placeholder directly, see 8585aec - in my testing this has the exact same results as your code. Can you please update your PR with this approach (or open it so I can) and I'll happily merge! Thanks. |
adamsilverstein
left a comment
There was a problem hiding this comment.
change to ui.placeholder.empty();
…on when dragging. Signed-off-by: Ben Huson <ben@thewhiteroom.net>
|
@adamsilverstein Works well for me - I've made the changes :) |
|
Perfect, thanks @benhuson! |


Fresh PR for jakemgold/simple-page-ordering#7
This PR copies the column structure of the dragged item, empties all the cell content and uses that as the placeholder to ensure the table structure is preserved. This prevents the page jump for a much smoother experience.