Skip to content

Commit

Permalink
fix(json-schema-2020-12): fix in collapsible behavior
Browse files Browse the repository at this point in the history
Refs #8513
  • Loading branch information
char0n committed Apr 26, 2023
1 parent 4ea28a9 commit f41c6ba
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ const JSONSchema = ({ schema, name }) => {
/**
* Event handlers.
*/
const handleExpansion = useCallback(() => {
setExpanded((prev) => !prev)
const handleExpansion = useCallback((e, expandedNew) => {
setExpanded(expandedNew)
!expandedNew && setExpandedDeeply(false)
}, [])
const handleExpansionDeep = useCallback(() => {
setExpanded((prev) => !prev)
setExpandedDeeply((prev) => !prev)
const handleExpansionDeep = useCallback((e, expandedDeepNew) => {
setExpanded(expandedDeepNew)
setExpandedDeeply(expandedDeepNew)
}, [])

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
}

&-body {
@include expansion-border;
margin: 2px 0;
border-left: 1px dashed rgba($section-models-model-container-background-color, 0.1);
}

&__limit {
Expand Down
5 changes: 5 additions & 0 deletions src/core/plugins/json-schema-2020-12/components/_all.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@mixin expansion-border {
margin: 0 0 0 20px;
border-left: 1px dashed rgba($section-models-model-container-background-color, 0.1);
}

@import './JSONSchema/json-schema';
@import './Accordion/accordion';
@import './ExpandDeepButton/expand-deep-button';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
.json-schema-2020-12 {
&__\$defs {
& ul {
@include expansion-border;
padding: 0;
margin: 0 0 0 20px;
border-left: 1px dashed rgba($section-models-model-container-background-color, 0.1);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
.json-schema-2020-12 {
&__\$vocabulary {
ul {
margin: 0 0 0 20px;
border-left: 1px dashed rgba($section-models-model-container-background-color, 0.1);
@include expansion-border;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
.json-schema-2020-12 {
&__allOf {
& ul {
margin: 5px 0 5px 0;

& > ul {
@include expansion-border;
padding: 0;
margin: 0 0 0 20px;
border-left: 1px dashed rgba($section-models-model-container-background-color, 0.1);
}
}

Expand Down

0 comments on commit f41c6ba

Please sign in to comment.