@formio/js 5.2.1-dev.6236.96bf618 → 5.2.1-dev.6243.b3a30c7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -528,8 +528,8 @@ class WebformBuilder extends Component_1.default {
528
528
  }
529
529
  return elem;
530
530
  };
531
- const hideShow = (group, show) => {
532
- if (show) {
531
+ const hideShow = (group, forceShow, toggle = false) => {
532
+ if (forceShow || (toggle && !Array.from(group.classList).includes('show'))) {
533
533
  group.classList.add(['show']);
534
534
  group.style.display = 'inherit';
535
535
  }
@@ -551,7 +551,9 @@ class WebformBuilder extends Component_1.default {
551
551
  const openByDefault = getAttribute(group, 'default') === 'true';
552
552
  const groupId = group.getAttribute('id').slice('group-'.length);
553
553
  const groupParent = getAttribute(group, 'parent').slice('#builder-sidebar-'.length);
554
- hideShow(group, ((openByDefault && groupParent === clickedId) || groupId === clickedParentId || groupIndex === index));
554
+ if (((openByDefault && groupParent === clickedId) || groupId === clickedParentId || groupIndex === index)) {
555
+ hideShow(group, ((openByDefault && groupParent === clickedId) || groupId === clickedParentId || groupIndex === index));
556
+ }
555
557
  });
556
558
  }, true);
557
559
  });
@@ -514,8 +514,8 @@ export default class WebformBuilder extends Component {
514
514
  }
515
515
  return elem;
516
516
  };
517
- const hideShow = (group, show) => {
518
- if (show) {
517
+ const hideShow = (group, forceShow, toggle = false) => {
518
+ if (forceShow || (toggle && !Array.from(group.classList).includes('show'))) {
519
519
  group.classList.add(['show']);
520
520
  group.style.display = 'inherit';
521
521
  }
@@ -537,7 +537,9 @@ export default class WebformBuilder extends Component {
537
537
  const openByDefault = getAttribute(group, 'default') === 'true';
538
538
  const groupId = group.getAttribute('id').slice('group-'.length);
539
539
  const groupParent = getAttribute(group, 'parent').slice('#builder-sidebar-'.length);
540
- hideShow(group, ((openByDefault && groupParent === clickedId) || groupId === clickedParentId || groupIndex === index));
540
+ if (((openByDefault && groupParent === clickedId) || groupId === clickedParentId || groupIndex === index)) {
541
+ hideShow(group, ((openByDefault && groupParent === clickedId) || groupId === clickedParentId || groupIndex === index));
542
+ }
541
543
  });
542
544
  }, true);
543
545
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.2.1-dev.6236.96bf618",
3
+ "version": "5.2.1-dev.6243.b3a30c7",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {