Bugzilla – Attachment 141492 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.77 KB, created by
Martin Renvoize
on 2022-10-07 10:45:11 UTC
(
hide
)
Description:
Bug 31646: Add Select2 focus to text search field
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2022-10-07 10:45:11 UTC
Size:
1.77 KB
patch
obsolete
>From e2ba170b2150e2a727ca559990ca6cb8f96883ef 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. > >Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > 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.20.1
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