Skip to content

Commit

Permalink
fixup! fix: focus feedback after submit
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVZ96 committed May 23, 2024
1 parent 72c6d36 commit 739d074
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Unreleased

* Adjust code styling for newer pylint versions.

Version 4.0.3 (2024-05-23)
---------------------------

* Set go-to-beginning button to hidden for Screen Readers

Version 4.0.2 (2024-04-24)
--------------------------

Expand Down
2 changes: 1 addition & 1 deletion drag_and_drop_v2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Drag and Drop v2 XBlock """
from .drag_and_drop_v2 import DragAndDropBlock

__version__ = "4.0.2"
__version__ = "4.0.3"
14 changes: 12 additions & 2 deletions drag_and_drop_v2/public/js/drag_and_drop.js
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,16 @@ function DragAndDropBlock(runtime, element, configuration) {
$root.find('.keyboard-help-dialog .modal-dismiss-button').focus();
};

var focusSuccessFeedback = function() {
var $feedback = $element.find('.final');
if ($feedback.is(':visible')) {
$feedback.attr('tabindex', '-1');
$feedback.focus();
return true;
};
return false;
}

var showKeyboardHelp = function(evt) {
var focusId = document.activeElement;
evt.preventDefault();
Expand Down Expand Up @@ -1829,7 +1839,7 @@ function DragAndDropBlock(runtime, element, configuration) {
applyState();

if (manually_closed) {
focusFirstDraggable();
focusSuccessFeedback() || focusFirstDraggable();
}
};

Expand Down Expand Up @@ -1903,7 +1913,7 @@ function DragAndDropBlock(runtime, element, configuration) {
}).always(function() {
state.submit_spinner = false;
applyState();
focusItemFeedbackPopup() || focusFirstDraggable();
focusItemFeedbackPopup() || focusSuccessFeedback() || focusFirstDraggable();
});
};

Expand Down

0 comments on commit 739d074

Please sign in to comment.