File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
1212- Clipboard copy button for [ SuperDebug] ( https://superforms.rocks/super-debug ) . Also fixed height when collapsed without label.
1313
14+ ### Fixed
15+
16+ - Storybook fix for missing ` page ` store.
17+
1418## [ 2.8.0] - 2024-03-05
1519
1620### Added
Original file line number Diff line number Diff line change @@ -454,7 +454,7 @@ export function superForm<
454454
455455 // Check multiple id's
456456 const _initialFormId = options . id ?? form . id ;
457- const _currentPage = get ( page ) ;
457+ const _currentPage = get ( page ) ?? ( STORYBOOK_MODE ? { } : undefined ) ;
458458
459459 if ( browser && options . warnings ?. duplicateId !== false ) {
460460 if ( ! formIds . has ( _currentPage ) ) {
@@ -1319,6 +1319,9 @@ export function superForm<
13191319 // Need to subscribe to catch page invalidation.
13201320 Unsubscriptions_add (
13211321 page . subscribe ( async ( pageUpdate ) => {
1322+ if ( STORYBOOK_MODE && pageUpdate === undefined ) {
1323+ pageUpdate = { status : 200 } as Page ;
1324+ }
13221325 const successResult = pageUpdate . status >= 200 && pageUpdate . status < 300 ;
13231326
13241327 if ( options . applyAction && pageUpdate . form && typeof pageUpdate . form === 'object' ) {
You can’t perform that action at this time.
0 commit comments