Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
jimchamp authored Oct 24, 2023
1 parent 163df60 commit dc742af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions openlibrary/plugins/openlibrary/js/breadcrumb_select/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
export function initBreadcrumbSelect(crumbs) {
const allowedKeys = new Set(['Tab', 'Enter', ' ']);
const preventedKeys = new Set(['ArrowUp', 'ArrowDown']);

// watch crumbs for changes,
// ensures it's a full value change, not a user exploring options via keyboard
function handleNavEvents(nav) {
let ignoreChange = false;

nav.addEventListener('change', () => {
if (ignoreChange) return;
// It's actually changed!
window.location = nav.value;
});

Expand Down
2 changes: 1 addition & 1 deletion openlibrary/templates/books/breadcrumb_select.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ <h2 class="breadcrumb-title">$breadcrumb_title</h2>
<option value=$url>$title</option>
</select>
</span>
</span>
</span>

0 comments on commit dc742af

Please sign in to comment.