Tweak tag list to add new row on input instead of change

Prevented interferance with the user's action if they interacted with
something below the tags, since a new row would be added on blur and
hence shift down positions.

For #3931
This commit is contained in:
Dan Brown 2023-01-26 16:10:47 +00:00
parent f6a6b11ec5
commit 3202f96181
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9

View File

@ -10,10 +10,11 @@ export class TagManager extends Component {
}
setupListeners() {
this.container.addEventListener('change', event => {
this.container.addEventListener('input', event => {
/** @var {AddRemoveRows} **/
const addRemoveComponent = window.$components.firstOnElement(this.addRemoveComponentEl, 'add-remove-rows');
if (!this.hasEmptyRows()) {
if (!this.hasEmptyRows() && event.target.value) {
addRemoveComponent.add();
}
});