Skip to content

Commit

Permalink
Merge pull request #1029 from nwanduka/patch-11
Browse files Browse the repository at this point in the history
Fixed keyboard accessibility issue on workbench page
  • Loading branch information
birm authored Aug 20, 2024
2 parents 7c488a1 + 06de7ff commit c876db4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
5 changes: 2 additions & 3 deletions apps/dev-workbench/workbench.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@
margin-left: 0 !important;
}
}
.navbar .nav-item .dropdown .options-button {
background-color: #000;
color: #fff;
.navbar .nav-item .options-button {
color: #000;
border: none;
}

Expand Down
27 changes: 18 additions & 9 deletions apps/dev-workbench/workbench.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,25 @@ $(document).ready(function() {
$('#stepper').show(400);
});

$('#goBack').click(function() {
window.history.back();
});

// Keydown event for the back button
$('#goBack').keydown(function(e) {
if (e.keyCode === 13) {
window.history.back();
// Unified function for going back
function goBack(e) {
// Prevent default action for keyboard events
if (e && e.preventDefault) {
e.preventDefault();
}
window.history.back();
}
});

// Click event for the back button
$('#goBack').on('click', goBack);

// Keydown event for the back button
$('#goBack').on('keydown', function(e) {
// Check for both Enter (13) and Space (32) key codes
if (e.keyCode === 13 || e.keyCode === 32) {
goBack(e);
}
});

// initialize Step 1
function dataSelect() {
Expand Down

0 comments on commit c876db4

Please sign in to comment.