Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ export const parameters = {
};
```

You can override the default timeout value to ensure the DOM is completely loaded before searching for the wrapper selector element.

```js
export const parameters = {
html: {
delay: 500, // default: 0
},
};
```

When using Web Components, the HTML will contain empty comments, i.e. `<!---->`.
If you want to remove these, use the `removeEmptyComments` parameter:

Expand Down
2 changes: 1 addition & 1 deletion addon/src/decorators/withHTML.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const withHTML = makeDecorator({
html = html.replace(/<!--\s*-->/g, '');
}
channel.emit(EVENT_CODE_RECEIVED, { html, options: parameters });
}, 0);
}, parameters.delay || 0);
return storyFn(context);
},
});
Expand Down