diff --git a/js/focal_point.js b/js/focal_point.js index 7bcb6b0..f5e7560 100644 --- a/js/focal_point.js +++ b/js/focal_point.js @@ -14,8 +14,11 @@ $(".focal-point", context).once('focal-point-hide-field').each(function() { // Add the "visually-hidden" class unless the focal point offset field // has an error. This will show the field for everyone when there is an - // error and for non-sighted users no matter what. + // error and for non-sighted users no matter what. We add it to both the + // input field and the form item to make sure the field is focusable + // while the entire form item is hidden for sighted users. if (!$(this).hasClass('error')) { + $(this).addClass('visually-hidden focusable'); $(this).closest('.form-item').addClass('visually-hidden'); } }); @@ -84,6 +87,7 @@ // Allow users to double-click the indicator to reveal the focal point form // element. this.$indicator.on('dblclick', function() { + self.$field.toggleClass('visually-hidden focusable'); self.$field.closest('.form-item').toggleClass('visually-hidden'); });