-
Notifications
You must be signed in to change notification settings - Fork 315
Open
Description
Hello team!
If you add a search component inside form, hitting enter will emit click event on closest button (in this case its a clear button).
As a result we can't read value from the formControl, because its cleared before submit event triggered.
We need to wrap search component into form, to enable enter hit on iOS devices. Without form iOS handle this button as return (new line).
Its a default html behaviour, if button has no type in form.
The easiest and safest fix is to add type="button" to a clear button.
How to reproduce:
<form
class="search-form"
(submit)="onFormSubmit($event)" // e.preventDefault() and e.stopPropagation();
>
<cds-search
[autocomplete]="'off'"
(clear)="clear()" // this event will be always triggered before submit and will always clear the value.
></cds-search>
</form>
Metadata
Metadata
Assignees
Labels
No labels