Fix the focus handling on the scheduler

This got broken when we removed the old GOV.UK Selection Buttons
javascript in a592898eff
This commit is contained in:
Chris Hill-Scott
2017-04-26 11:23:39 +01:00
parent c996d5f4aa
commit d731de6edf

View File

@@ -56,7 +56,7 @@
let focusSelected = function() {
setTimeout(
() => $('[type=radio]:checked').next('label').blur().trigger('focus').addClass('selected'),
10
50
);
};
@@ -67,7 +67,6 @@
let $component = $(component);
let render = (state, data) => {
$component.html(states[state].render(data));
new GOVUK.SelectionButtons('.block-label input');
};
let choices = $('label', $component).toArray().map(function(element) {
let $element = $(element);
@@ -92,7 +91,7 @@
),
'name': name
});
$('.js-option').eq(0).parent('label').trigger('focus');
focusSelected();
})
.on('click', '.js-option', function(event) {