Skip to content

Commit

Permalink
remove input text after selecting in relation or select (#2815)
Browse files Browse the repository at this point in the history
Co-authored-by: grigoriy-ivanov <grigoriy.ivanvov.on@gmail.com>
  • Loading branch information
grigoriy-ivanov and grigoriy-ivanov authored Mar 22, 2024
1 parent a3d6e06 commit 29c1964
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions resources/js/controllers/relation_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export default class extends ApplicationController {
},
onDelete: () => !! this.data.get('allow-empty'),
load: (query, callback) => this.search(query, callback),
onItemAdd: function() {
this.setTextboxValue('');
this.refreshOptions(false);
}
});
}

Expand Down
4 changes: 4 additions & 0 deletions resources/js/controllers/select_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export default class extends ApplicationController {
no_results: () => `<div class="no-results">${this.data.get('message-notfound')}</div>`,
},
onDelete: () => !! this.data.get('allow-empty'),
onItemAdd: function() {
this.setTextboxValue('');
this.refreshOptions(false);
}
});
}

Expand Down

0 comments on commit 29c1964

Please sign in to comment.