Skip to content

Commit

Permalink
Merge pull request #839 from mulesoft/fix/W-14071465/Editing-code-whi…
Browse files Browse the repository at this point in the history
…le-Console-is-opened-changes-the-MS-URL

[W14071465] Editing code while Console is opened changes the MS URL
  • Loading branch information
alexpmule authored Nov 17, 2023
2 parents cd3e0c9 + 675a375 commit 5f01137
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/ApiConsole.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable lit-a11y/click-events-have-key-events */
/**
@license
Copyright 2018 The Advanced REST client authors <[email protected]>
Expand Down Expand Up @@ -370,6 +369,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
super();
this._tryitHandler = this._tryitHandler.bind(this);
this._handleServerChange = this._handleServerChange.bind(this);
this._handleSelectionChange = this._handleSelectionChange.bind(this);

this.page = 'docs';
this.compatibility = false;
Expand Down Expand Up @@ -659,6 +659,15 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
this.serverValue = value;
}

/**
* Handler for the `apiselectionchange` event dispatched from the components.
* @param {CustomEvent} e
*/
_handleSelectionChange(e) {
const { value } = e.detail;
this.selectedShape = value;
}

render() {
return html`
${this._mainContentTemplate()}
Expand Down Expand Up @@ -769,6 +778,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
.eventsTarget="${eventsTarget}"
.credentialsSource="${credentialsSource}"
?persistCache="${persistCache}"
@api-request-panel-selection-changed="${this._handleSelectionChange}"
>
<slot name="custom-base-uri" slot="custom-base-uri"></slot>
</api-request-panel>`;
Expand Down

0 comments on commit 5f01137

Please sign in to comment.