I have an input and a button that reads the value and add it to the list.
Here is the code:
<div class="row mt-2">
<div class="col-8">
<input
#sparePartsInput
class="form-control"
type="text"
name="sparePart"
maxlength="32"
/>
{{sparePartsInput.value}}
</div>
<div class="col-4">
<button
[disabled]="sparePartsInput.value == '' || sparePartsInput.value.trim() == ''"
type="button"
class="btn btn-primary"
(click)="addItemToSpareParts(sparePartsInput.value)>
<i class="fa fa-plus"></i>
</button>
</div>
</div>
I set the button disabled when the value of the input is empty.
But when I select the value with CTRL+A and delete, its value seems not to empty. I need to click delete one more time and then it will be cleared.
How can I fix this stuff?