Skip to content

Commit

Permalink
fix: display groups with no outline with a dashed outline in the editor
Browse files Browse the repository at this point in the history
Closes #1084
  • Loading branch information
Skaiir committed Mar 26, 2024
1 parent 561e525 commit 4b7eb7e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 7 additions & 0 deletions packages/form-js-editor/assets/form-js-editor-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,21 @@
border-color: var(--color-borders-group);
}

.fjs-editor-container .fjs-children .fjs-element.fjs-dashed-outlined {
border-color: var(--color-borders-group);
border-style: dashed;
}

.fjs-editor-container .fjs-children .fjs-element.fjs-editor-selected {
border-color: var(--color-children-selected-border) !important;
background-color: var(--color-children-selected-background);
border-style: solid;
}

.fjs-editor-container .fjs-children .fjs-element:hover.fjs-editor-hovered,
.fjs-editor-container .fjs-children .fjs-element:focus {
border-color: var(--color-children-hover-border);
border-style: solid;
}

.fjs-editor-container .fjs-layout-column:first-child > .fjs-element[data-field-type="group"],
Expand Down
8 changes: 5 additions & 3 deletions packages/form-js-editor/src/render/components/FormEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,10 @@ function Element(props) {
classes.push('fjs-editor-selected');
}

if (showOutline) {
classes.push('fjs-outlined');
const grouplike = [ 'group', 'dynamiclist' ].includes(type);

if (grouplike) {
classes.push(showOutline ? 'fjs-outlined' : 'fjs-dashed-outlined');
}

if (hovered) {
Expand All @@ -182,7 +184,7 @@ function Element(props) {

return classes.join(' ');

}, [ hovered, isSelected, props.class, showOutline ]);
}, [ hovered, isSelected, props.class, showOutline, type ]);

const onRemove = (event) => {
event.stopPropagation();
Expand Down

0 comments on commit 4b7eb7e

Please sign in to comment.