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

Fix mithril DOMException when reordering gamecards #2396

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RoepStoep
Copy link

fixes dom exception when mithril tries to reorder the game cards after they are wrapped by Siema's slider frames

steps to reproduce (landscape orientation only, there may be other ways):

  • start two correspondence games where it is the opponent to move
  • click the ongoing games button top-right and find the game second in list
  • close the overlay again and make a move for the opponent in the second game
  • open ongoing games again, and a DOMException will appear

DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node

mithril tries to move the second game to the front after the session is refreshed, but can't because the game cards have been wrapped in slider divs by siema

this is fixed by creating the wrapper divs from mithril, and only let siema do the styling
there may be other (better?) ways, but this seemed least intrusive to me

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

Successfully merging this pull request may close these issues.

1 participant