From dba506a20e85efb028219c505e5017537f5234b3 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Tue, 4 Jan 2022 11:30:44 +0000 Subject: [PATCH] Added search autofocus on entity-selector-popup Closes #3127 --- resources/js/components/entity-selector-popup.js | 3 +++ resources/views/entities/selector.blade.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/js/components/entity-selector-popup.js b/resources/js/components/entity-selector-popup.js index 0104eace7..231f1021f 100644 --- a/resources/js/components/entity-selector-popup.js +++ b/resources/js/components/entity-selector-popup.js @@ -7,6 +7,8 @@ class EntitySelectorPopup { setup() { this.elem = this.$el; this.selectButton = this.$refs.select; + this.searchInput = this.$refs.searchInput; + window.EntitySelectorPopup = this; this.callback = null; @@ -20,6 +22,7 @@ class EntitySelectorPopup { show(callback) { this.callback = callback; this.elem.components.popup.show(); + this.searchInput.focus(); } hide() { diff --git a/resources/views/entities/selector.blade.php b/resources/views/entities/selector.blade.php index 687392dea..5285b0ec4 100644 --- a/resources/views/entities/selector.blade.php +++ b/resources/views/entities/selector.blade.php @@ -4,7 +4,7 @@ option:entity-selector:entity-types="{{ $entityTypes ?? 'book,chapter,page' }}" option:entity-selector:entity-permission="{{ $entityPermission ?? 'view' }}"> - +
@include('common.loading-icon')
@if($showAdd ?? false)