Skip to content

Commit

Permalink
Followed platform conventions for showing search shortcut key
Browse files Browse the repository at this point in the history
Changed display of the search shortcut key to "⌘ K" on Mac and "Ctrl+K" elsewhere.

(\u200a is a hair space, which looks better than a full space or no space.)

Fixes #1960.
  • Loading branch information
medmunds committed Feb 25, 2025
1 parent 7fb6534 commit 2bf34eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion djangoproject/static/js/djangoproject.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ document.querySelector('.menu-button').addEventListener('click', function () {

const original_placeholder = el.getAttribute('placeholder');
const is_mac = navigator.userAgent.indexOf('Mac') !== -1;
const new_value = `${original_placeholder} (${is_mac ? '⌘' : 'Ctrl'} + K)`;
const new_value = `${original_placeholder} (${is_mac ? '⌘\u200aK' : 'Ctrl+K'})`;

el.setAttribute('placeholder', new_value);
})();
Expand Down

0 comments on commit 2bf34eb

Please sign in to comment.