formio / formio.js

JavaScript powered Forms with JSON Form Builder

Home Page:https://formio.github.io/formio.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Builder] Tab will jump to first tab when component already on the form is dropped in

ShermanE1 opened this issue · comments

Environment

Steps to Reproduce

  1. Add any Basic component to a form
  2. Add a Tabs component with two tabs to the same form
  3. Select the second tab
  4. Drag & drop the component that was added in the first step to the second tab

Expected behavior

Tabs component should still be in the second tab

Observed behavior

Tabs component will switch to display the first tab

Example

screen-capture.webm

Note: A similar issue seems to have been fixed a while so that when dragging a new component from the side panel into a tab it renders the correct tab (#1689); however, the issue is still present when dragging a component that is already on the form into a tab.

I just tried this out with the latest version of our renderer and it seems to be working for me. When I drag a component into the second tab it stays on the second tab. Can you provide a jsfiddle of this not working for you?

Yes, this does appear to be fixed in the latest version. Thank you!

After updating to the latest version, it seems that this error still exists. If you navigate to Tab 2 in this jfiddle and drag the Last Name field into it, the tab component will switch to the first tab.

This only happens when dragging components that are already on the form into the second tab. If you drag a new component into the second tab, it will stay on the correct tab.

Very interesting, and thank you for providing a JSFiddle!!! That is super helpful. This is most likely due to the difference of "addComponent" and "moveComponent" within the form builder. Definitely a bug, but is very minor and may have a hard time getting prioritized. If you submit a pull request, then we will be happy to include this in our next build.