Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix select input and number input focusing after opening modal
dominik-zeglen2d8999cd0da8
diff --git a/saleor/static/dashboard/js/components/modal.js b/saleor/static/dashboard/js/components/modal.jsindex 843450076d..aa298b8139 100644--- a/saleor/static/dashboard/js/components/modal.js+++ b/saleor/static/dashboard/js/components/modal.js@@ -1,6 +1,12 @@import {initSelects} from './utils';import SVGInjector from 'svg-injector-2';+const focusInputs = [+ 'textarea',+ 'input[type="text"]:not(.select-dropdown)',+ 'input[type="number"]'+];+export default $(document).ready((e) => {$('body').on('click', '.modal-trigger-custom', function (e) {let that = this;@@ -12,7 +18,7 @@ export default $(document).ready((e) => {$modal.html(response);initSelects();$modal.modal('open');- $modal.find('textarea, input[type="text"]')[0].focus();+ $modal.find(focusInputs.join(','))[0].focus();// Image checkbox selector$('.image_select-item-overlay').on('click', function (e) {let id = $(e.target).attr('id');