MDL-68378 core: update single_select to listen to accessibleChange event

This commit is contained in:
Shamim Rezaie 2020-03-17 07:17:25 +11:00
parent df35a03367
commit a97c40cf83

View File

@ -116,8 +116,9 @@
</form>
</div>
{{#js}}
require(['jquery'], function($) {
$('#{{id}}').change(function() {
require(['jquery', 'core/custom_interaction_events'], function($, CustomEvents) {
CustomEvents.define('#{{id}}', [CustomEvents.events.accessibleChange]);
$('#{{id}}').on(CustomEvents.events.accessibleChange, function() {
var ignore = $(this).find(':selected').attr('data-ignore');
if (typeof ignore === typeof undefined) {
$('#{{formid}}').submit();