From b37ba3ccfdf5fa555973e26c7d7fb529b53ac8fd Mon Sep 17 00:00:00 2001 From: Sam Georges Date: Mon, 29 Sep 2014 14:15:49 +1000 Subject: [PATCH] Fixes flaw in JS, custom dropdowns now focus when invalid --- modules/backend/assets/js/october.controls.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/backend/assets/js/october.controls.js b/modules/backend/assets/js/october.controls.js index dc94b45c1..cc25822aa 100644 --- a/modules/backend/assets/js/october.controls.js +++ b/modules/backend/assets/js/october.controls.js @@ -51,9 +51,14 @@ formatSelection: formatSelectOption, escapeMarkup: function(m) { return m; } }) - - $(document).on('disable', 'select.custom-select', function(event, status){ - $(this).select2('enable', !status) - }) }) + + $(document).on('disable', 'select.custom-select', function(event, status){ + $(this).select2('enable', !status) + }) + + $(document).on('focus', 'select.custom-select', function(event){ + setTimeout($.proxy(function() { $(this).select2('focus') }, this), 10) + }) + })(jQuery); \ No newline at end of file