Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed keyboard accessibility issue on workbench page #1029

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading