mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-27 10:49:45 +08:00
Fixed audit log user dropdown usability issue
User search input blur would trigger the submission of the search filters which would cause strange thing where you'd click on a search filtered user which would blur the input hence submit, but the user would think they've clicked the user and the page would reload but the input had not updated at that point. Related to #2863
This commit is contained in:
parent
b1ee1a856f
commit
7a8954ee65
|
@ -27,6 +27,7 @@ class DropdownSearch {
|
|||
this.runLocalSearch(input);
|
||||
} else {
|
||||
this.toggleLoading(true);
|
||||
this.listContainerElem.innerHTML = '';
|
||||
this.runAjaxSearch(input);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,14 @@
|
|||
class SubmitOnChange {
|
||||
|
||||
setup() {
|
||||
this.$el.addEventListener('change', () => {
|
||||
this.filter = this.$opts.filter;
|
||||
|
||||
this.$el.addEventListener('change', (event) => {
|
||||
|
||||
if (this.filter && !event.target.matches(this.filter)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const form = this.$el.closest('form');
|
||||
if (form) {
|
||||
form.submit();
|
||||
|
|
|
@ -3,7 +3,6 @@ import {onChildEvent} from "../services/dom";
|
|||
class UserSelect {
|
||||
|
||||
setup() {
|
||||
|
||||
this.input = this.$refs.input;
|
||||
this.userInfoContainer = this.$refs.userInfo;
|
||||
|
||||
|
|
|
@ -41,7 +41,9 @@
|
|||
</div>
|
||||
@endforeach
|
||||
|
||||
<div class="form-group ml-auto" component="submit-on-change">
|
||||
<div class="form-group ml-auto"
|
||||
component="submit-on-change"
|
||||
option:submit-on-change:filter='[name="user"]'>
|
||||
<label for="owner">{{ trans('settings.audit_table_user') }}</label>
|
||||
@include('components.user-select', ['user' => $listDetails['user'] ? \BookStack\Auth\User::query()->find($listDetails['user']) : null, 'name' => 'user', 'compact' => true])
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user