Skip to content

Commit

Permalink
Tweak tag list to add new row on input instead of change
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ssddanbrown committed Jan 26, 2023
1 parent f6a6b11 commit 3202f96
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions resources/js/components/tag-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
});
Expand Down

0 comments on commit 3202f96

Please sign in to comment.