From 91c267bd90dcfe604da1e98827e0895b6b03b687 Mon Sep 17 00:00:00 2001 From: Guillaume Cusnieux Date: Wed, 14 Dec 2022 15:06:13 +0100 Subject: [PATCH] fix(gv-input): dispatch submit event only on required icon --- src/atoms/gv-input/gv-input.js | 8 +++++--- testing/resources/apim-resource-types.json | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/atoms/gv-input/gv-input.js b/src/atoms/gv-input/gv-input.js index 1ff07da5..dc190d77 100644 --- a/src/atoms/gv-input/gv-input.js +++ b/src/atoms/gv-input/gv-input.js @@ -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) { @@ -462,7 +464,7 @@ export class GvInput extends InputElement(LitElement) { _renderClearIcon() { if (this.isClearable) { return html`
- +
`; } return ''; diff --git a/testing/resources/apim-resource-types.json b/testing/resources/apim-resource-types.json index 9feba4c4..b536f2f9 100644 --- a/testing/resources/apim-resource-types.json +++ b/testing/resources/apim-resource-types.json @@ -74,7 +74,8 @@ "clientSecret": { "title": "Client Secret", "description": "The client secret.", - "type": "string" + "type": "string", + "writeOnly": true }, "userClaim": { "title": "User claim",