Skip to content

Commit

Permalink
fix(gv-input): dispatch submit event only on required icon
Browse files Browse the repository at this point in the history
  • Loading branch information
gcusnieux committed Dec 14, 2022
1 parent bdd3244 commit 91c267b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/atoms/gv-input/gv-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,11 @@ export class GvInput extends InputElement(LitElement) {
return this._type;
}

_onIconClick() {
_onIconClick(e) {
dispatchCustomEvent(this, 'icon-click', this.value);
dispatchCustomEvent(this, 'submit', this.value);
if (e.target.classList.contains('submit')) {
dispatchCustomEvent(this, 'submit', this.value);
}
}

_onIconVisibleClick(e) {
Expand Down Expand Up @@ -462,7 +464,7 @@ export class GvInput extends InputElement(LitElement) {
_renderClearIcon() {
if (this.isClearable) {
return html`<div class="box-icon box-icon-clear">
<gv-icon class="link" shape="code:error" title="${i18n('gv-input.clear')}" @click="${this.clear}"></gv-icon>
<gv-icon class="link submit" shape="code:error" title="${i18n('gv-input.clear')}" @click="${this.clear}"></gv-icon>
</div>`;
}
return '';
Expand Down
3 changes: 2 additions & 1 deletion testing/resources/apim-resource-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
"clientSecret": {
"title": "Client Secret",
"description": "The client secret.",
"type": "string"
"type": "string",
"writeOnly": true
},
"userClaim": {
"title": "User claim",
Expand Down

0 comments on commit 91c267b

Please sign in to comment.