From c518c78ca45d6b97bbd1441a3957a0ca21fa488e Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Fri, 22 Sep 2023 10:20:26 +0100 Subject: [PATCH] MDL-79463 output: invert logic in url_select change event. Avoids eslint `consistent-return` errors (because we previously only returned from the conditional branch). --- lib/templates/url_select.mustache | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/templates/url_select.mustache b/lib/templates/url_select.mustache index 4a10e238e35..845cee450b1 100644 --- a/lib/templates/url_select.mustache +++ b/lib/templates/url_select.mustache @@ -78,10 +78,9 @@ require(['jquery', 'core/custom_interaction_events'], function($, CustomEvents) { CustomEvents.define('#{{id}}', [CustomEvents.events.accessibleChange]); $('#{{id}}').on(CustomEvents.events.accessibleChange, function() { - if (!$(this).val()) { - return false; + if ($(this).val()) { + $('#{{formid}}').submit(); } - $('#{{formid}}').submit(); }); }); {{/js}}