Skip to content

Commit 5f01137

Browse files
authored
Merge pull request #839 from mulesoft/fix/W-14071465/Editing-code-while-Console-is-opened-changes-the-MS-URL
[W14071465] Editing code while Console is opened changes the MS URL
2 parents cd3e0c9 + 675a375 commit 5f01137

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ApiConsole.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable lit-a11y/click-events-have-key-events */
21
/**
32
@license
43
Copyright 2018 The Advanced REST client authors <[email protected]>
@@ -370,6 +369,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
370369
super();
371370
this._tryitHandler = this._tryitHandler.bind(this);
372371
this._handleServerChange = this._handleServerChange.bind(this);
372+
this._handleSelectionChange = this._handleSelectionChange.bind(this);
373373

374374
this.page = 'docs';
375375
this.compatibility = false;
@@ -659,6 +659,15 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
659659
this.serverValue = value;
660660
}
661661

662+
/**
663+
* Handler for the `apiselectionchange` event dispatched from the components.
664+
* @param {CustomEvent} e
665+
*/
666+
_handleSelectionChange(e) {
667+
const { value } = e.detail;
668+
this.selectedShape = value;
669+
}
670+
662671
render() {
663672
return html`
664673
${this._mainContentTemplate()}
@@ -769,6 +778,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
769778
.eventsTarget="${eventsTarget}"
770779
.credentialsSource="${credentialsSource}"
771780
?persistCache="${persistCache}"
781+
@api-request-panel-selection-changed="${this._handleSelectionChange}"
772782
>
773783
<slot name="custom-base-uri" slot="custom-base-uri"></slot>
774784
</api-request-panel>`;

0 commit comments

Comments
 (0)