fix(sdk): set the hideNavigation param correctly for embeds #1654
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have a bug with the
hideNavigation
option for embed methods.Instead of adding
hideNavigation=1
to the URL, we addhideNavigation=1;
, resulting in a value of1;
which gets ignored by the StackBlitz editor.This PR fixes this issue, and constructs the query string by joining an array of
key=value
strings instead of adding having to deal with adding&
or not for each parameter.There are a couple other changes:
The
theme
parameter is restricted to'light'
or'dark'
. Though maybe we should accept any string, even though we're not supporting other values? Happy to roll back that change if we want to keep it open. (I’m noticing that it's not documented on https://developer.stackblitz.com/docs/platform/javascript-sdk/#embed-options yet?)The
devtoolsheight
option now accepts the values0
and100
. In particular, I’ve seen users of the SDK usedevToolsHeight: 99
because100
was filtered out by the SDK, even thoughdevtoolsheight=100
in the URL does work.