Skip to content

Commit 2a34246

Browse files
committed
Collapsible bar was a submit button and didn't toggle the collapsed status properly.
1 parent 5fbe4d3 commit 2a34246

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Headlines: Added, Changed, Deprecated, Removed, Fixed, Security
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.7.3] - 2023-09-28
9+
10+
### Fixed
11+
12+
- SuperDebug: Collapsible bar was a submit button and didn't toggle the collapsed status properly.
13+
814
## [1.7.2] - 2023-09-23
915

1016
### Fixed

src/lib/client/SuperDebug.svelte

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,14 @@
118118
function setCollapse(status = undefined) {
119119
let data;
120120
const route = $page.route.id ?? '';
121+
121122
try {
122-
data = JSON.parse(sessionStorage.SuperDebug);
123-
if (!('collapsed' in data)) data.collapsed = {};
123+
if (sessionStorage.SuperDebug) {
124+
data = JSON.parse(sessionStorage.SuperDebug);
125+
}
126+
127+
data = { collapsed: data && data.collapsed ? data.collapsed : {} };
128+
124129
data.collapsed[route] =
125130
status === undefined ? data.collapsed[route] ?? false : status;
126131
} catch {
@@ -334,6 +339,7 @@
334339
></pre>
335340
{#if collapsible}
336341
<button
342+
type="button"
337343
on:click|preventDefault={() => setCollapse(!collapsed)}
338344
class="super-debug--collapse"
339345
>

0 commit comments

Comments
 (0)