contributte / contributte/datagrid

SortableJS is not reinitialised when the grid is redrawn

Open
#1,308 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
296
Forks
215
PR merge metrics
No merged PRs in 30d

Description

I think the sortable plugin mixes two concerns - updating some DOM after the sortable column headers are clicked and initializing the sortable drag&drop plugin. I think these should be split to separate plugins or at least make the sortable constructor argument optional.

In addition, there is a bug where the sortable is not reinitialised when payload._datagrid_sort is not set in the payload, this is set only when the filter form is submitted.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with assets/plugins/integrations/sortable.ts and trace how the sortable constructor and DOM updates are handled after the grid is redrawn. Check the payload path involving payload._datagrid_sort, especially when it is absent because only the filter form was submitted. Done means sortable drag-and-drop is reinitialised after redraws and the plugin responsibilities or constructor argument are appropriately separated.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.