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

Form components disappear after moving them around in a row following preact 10.16.x update #1057

Closed
christian-konrad opened this issue Feb 19, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@christian-konrad
Copy link
Contributor

christian-konrad commented Feb 19, 2024

Describe the Bug

Form components disappear after moving them around in a row .

Steps to Reproduce

  1. Add components into some rows.
  2. Drag components from one row into another.
  3. Occasionally, components start to disappear. Once that happened, they continue to disappear on every drag, and require the form to re-render to appear again.

See videos:

Bildschirmaufnahme.2024-02-19.um.20.21.32.mov
Bildschirmaufnahme.2024-02-19.um.20.23.04.mov

Expected Behavior

Components never disappear after dragging.

Environment

  • form-js v1.7
@marcosgvieira
Copy link

@Skaiir can you please update the status on this one?

@Skaiir Skaiir added the backlog Queued in backlog label Mar 6, 2024
@Skaiir Skaiir changed the title Form components disappear after moving them around in a row Form components disappear after moving them around in a row following preact 10.16.x update Mar 6, 2024
@Skaiir
Copy link
Contributor

Skaiir commented Mar 6, 2024

So there's two aspects of this bug. This is an old bug that resurfaced due to preact getting upgraded in the web modeler somehow.

The issue is as follows:

  • Preact moves components around when it re-renders
  • Dragula moves divs around as well
  • The combination of the two causes problems with preact's diffing algorithm which causes it to delete the new element entirely in some circumstances
  • With version 10.16.x, preact started doing some smarter diffing, which is good for performance, but uncovers this bug which always existed, and was simply being fixed by preact's less smart, more brute force diffing.

How to fix:

@Skaiir
Copy link
Contributor

Skaiir commented Mar 6, 2024

There is also this issue which tracks the same problem:

#760

Skaiir added a commit that referenced this issue Mar 6, 2024
@Skaiir Skaiir added needs review Review pending and removed backlog Queued in backlog labels Mar 6, 2024
@Skaiir
Copy link
Contributor

Skaiir commented Mar 6, 2024

Some updates here, the reason why the bug resurfaced in web modeler was that our preact version restricting was yarn specific, and wasn't updated during the change to npm. I have a fix for this on web modeler here

@Skaiir
Copy link
Contributor

Skaiir commented Mar 6, 2024

Fixed in web modeler via https://github.com/camunda/web-modeler/commit/b4cd239b943b75cd2359cdf56fde24c34682ec89, I will close this issue and use the older one for future reference.

@Skaiir Skaiir closed this as completed Mar 6, 2024
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Mar 6, 2024
Skaiir added a commit that referenced this issue Mar 6, 2024
@Ken-Scofield
Copy link

mark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants