Skip to content

Commit

Permalink
fix: provide args values from url to control
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavlo Zhukov committed Oct 28, 2021
1 parent 0787164 commit 109b330
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/preview-web/src/PreviewWeb.tsx
Expand Up @@ -533,6 +533,17 @@ export class PreviewWeb<TFramework extends AnyFramework> {
unboundStoryFn,
};

// Populate args from url to ArgsTable controls.
if (notYetRendered) {
const { args } = this.urlStore.selectionSpecifier;
if (Object.keys(args).length > 0) {
this.channel.emit(Events.STORY_ARGS_UPDATED, {
storyId: id,
updatedArgs: args,
});
}
}

await runPhase('rendering', () => this.renderToDOM(renderContext, element));
notYetRendered = false;
if (ctrl.signal.aborted) return;
Expand Down

0 comments on commit 109b330

Please sign in to comment.