FIX: Add autofocus to users chooser on the assign modal (#148)

The users chooser on the assign modal is the primary input field on the modal, so it makes to shift focus to it when the modal is opened. This PR needs 0f807ba85b in core to work properly, but it won't cause errors (won't have any effects) if it's deployed to a site that doesn't have that commit.
This commit is contained in:
Osama Sayegh 2021-02-23 14:05:34 +03:00 committed by GitHub
parent 394f857096
commit a90e7ab7e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -1,12 +1,14 @@
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { inject as controller } from "@ember/controller";
import { not } from "@ember/object/computed";
export default Ember.Controller.extend({
topicBulkActions: controller(),
assignSuggestions: null,
allowedGroups: null,
taskActions: Ember.inject.service(),
autofocus: not("capabilities.touch"),
init() {
this._super(...arguments);

View File

@ -11,6 +11,7 @@
includeGroups=false
groupMembersOf=allowedGroups
maximum=1
autofocus=autofocus
)
}}
<div class="assign-suggestions">