Bugzilla – Attachment 141175 Details for
Bug 31646
Focus input by default when clicking on a dropdown field in the cataloguing editor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31646: Add Select2 focus to text search field
Bug-31646-Add-Select2-focus-to-text-search-field.patch (text/plain), 1.69 KB, created by
Lucas Gass
on 2022-09-30 17:56:00 UTC
(
hide
)
Description:
Bug 31646: Add Select2 focus to text search field
Filename:
MIME Type:
Creator:
Lucas Gass
Created:
2022-09-30 17:56:00 UTC
Size:
1.69 KB
patch
obsolete
>From 8a66f0f2b20b4cbde4c79b2b4076a29909f1f49c Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 30 Sep 2022 17:48:25 +0000 >Subject: [PATCH] Bug 31646: Add Select2 focus to text search field > >To test: >1. Edit a biblio record >2. Go to tab 9 to find the item type MARC field 942$c >3. Click on the field to select an item type >4. Notice you have to click again on the search field to begin typing to search for your item type >5. Apply patch/clear browser cache >6. Try steps 2-3 again, the focus should now be on the search text field >7. Try another select2 dropdown on the same page like the 942$n ( Suppress in OPAC ), it should also default to the text search field. >8. Try other places in Koha that feature this kind of select2, like when placing hold. > >Note: Using $(document).on here instead of $(".select2").on becuase there are several instances where there are more than 1 select2 dropdown on a single page. This allows for the text search field to default each time you click on a different dropdown. > >https://bugs.koha-community.org/show_bug.cgi?id=31663 >--- > koha-tmpl/intranet-tmpl/prog/js/select2.js | 4 ++++ > 1 file changed, 4 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/select2.js b/koha-tmpl/intranet-tmpl/prog/js/select2.js >index 52d910a2fa..bc11558e11 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/select2.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/select2.js >@@ -36,6 +36,10 @@ $(document).ready(function(){ > $(this).off("select2:opening.cancelOpen"); > }); > }); >+ >+ $(document).on("select2:open", function () { >+ document.querySelector(".select2-container--open .select2-search__field").focus(); >+ }); > }); > > (function($) { >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31646
:
141175
|
141293
|
141492