setup() {
this.elem = this.$el;
this.selectButton = this.$refs.select;
+ this.searchInput = this.$refs.searchInput;
+
window.EntitySelectorPopup = this;
this.callback = null;
show(callback) {
this.callback = callback;
this.elem.components.popup.show();
+ this.searchInput.focus();
}
hide() {
option:entity-selector:entity-types="{{ $entityTypes ?? 'book,chapter,page' }}"
option:entity-selector:entity-permission="{{ $entityPermission ?? 'view' }}">
<input refs="entity-selector@input" type="hidden" name="{{$name}}" value="">
- <input type="text" placeholder="{{ trans('common.search') }}" @if($autofocus ?? false) autofocus @endif refs="entity-selector@search">
+ <input refs="entity-selector@search entity-selector-popup@searchInput" type="text" placeholder="{{ trans('common.search') }}" @if($autofocus ?? false) autofocus @endif>
<div class="text-center loading" refs="entity-selector@loading">@include('common.loading-icon')</div>
<div refs="entity-selector@results"></div>
@if($showAdd ?? false)