Skip to content
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

Allow multiple <Kanban> elements on the same page #66

Open
dev-guy opened this issue Aug 29, 2023 · 0 comments
Open

Allow multiple <Kanban> elements on the same page #66

dev-guy opened this issue Aug 29, 2023 · 0 comments

Comments

@dev-guy
Copy link
Contributor

dev-guy commented Aug 29, 2023

Currently only one component can be created by an application because store objects (e.g., $columns) are module-scoped variables (singletons).

First, each <Kanban> component needs it own store. This can be fixed with Svelte contexts. Another benefit of this change is that the memory related to a board will be released when it is no longer visible. This will be done in #60.

Secondly, when one page contains two boards arranged vertically, dragging a card in the lower Kanban board causes a card in the upper board to move. Example: https://github.com/V-Py/svelte-kanban/assets/12297328/0d0e751b-4f34-4a65-83b8-36499aeef950

Changes Needed (beyond #60)

  1. Replace getElementsByClassName with getElementById using Cards' new id properties as described in Assign unique ids to boards, columns, and cards #61
  2. Change the value of id attributes from card-A-col-B to board-A-card-B-col-C using the board's id as described in Assign unique ids to boards, columns, and cards #61
  3. Call getElementId using the new value describe in 2 above
  4. Column.svelte creates elements with ids like title-column{index_col} .. this is a good time to fix the spelling error for input-colum{index_col} (the n is missing). The board id should be added to these ids.
  5. Scan the code for other instances of id="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant