I’m seeing something odd, and I want to solve it before I move on.
I have a dropdown (select) control with two options ‘Edit’ and ‘Delete’ in a table as my final column in each row.
So the user can select to take an action on the item int he row.
<tbody>
{{#each eTypeslist}}
<tr>
<td>{{entityTypeName}}</td>
<td>{{entityTypeDesc}}</td>
<td class="shortWidth">
<select class="entityTypeActions">
<option value="" disabled selected></option>
<option value="edit">Edit</option>
<option value="delete">Delete</option>
</select>
</td>
</tr>
{{/each}}
</tbody>
I’m using a change event to detect when the value in any row is changed, and when I console log out, I see the event being recorded twice with each change.
'change .entityTypeActions' (event) {
let typeId = this._id;
let action = event.target.value;
console.log("Selection " + action + " for " + typeId);
},
Which logs out:
2 entityTypeGrid.js:22 Selection delete for depBQ3C8S4TuNS3zD
2 entityTypeGrid.js:22 Selection edit for zhznA5XQ4bA5yN4i8
The ‘2’ in front of each line indicates that the change was logged 2 times, but I only made each selection 1 time.
Any idea what’s going on here?