fix caps on focus and ios/android disabled display
This commit is contained in:
@@ -84,9 +84,10 @@ const init = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener('keydown', function (e) {
|
window.addEventListener('keydown', function (e) {
|
||||||
|
const key = e.key.toLowerCase();
|
||||||
const isMac = navigator.userAgent.toUpperCase().includes('MAC');
|
const isMac = navigator.userAgent.toUpperCase().includes('MAC');
|
||||||
const isCtrlK = e.ctrlKey && e.key === 'k';
|
const isCtrlK = e.ctrlKey && key === 'k';
|
||||||
const isCmdK = isMac && e.metaKey && e.key === 'k';
|
const isCmdK = isMac && e.metaKey && key === 'k';
|
||||||
|
|
||||||
if (isCtrlK || isCmdK) {
|
if (isCtrlK || isCmdK) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -95,9 +96,15 @@ const init = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const shortcutK = document.getElementById('shortcut');
|
const shortcutK = document.getElementById('shortcut');
|
||||||
shortcutK.textContent = navigator.userAgent.toUpperCase().includes('MAC')
|
const isIosOrAndroid = /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
|
||||||
? '⌘ K'
|
|
||||||
: 'Ctrl K';
|
if (isIosOrAndroid) {
|
||||||
|
shortcutK.style.display = 'none';
|
||||||
|
} else {
|
||||||
|
shortcutK.textContent = navigator.userAgent.toUpperCase().includes('MAC')
|
||||||
|
? '⌘ + K'
|
||||||
|
: 'Ctrl + K';
|
||||||
|
}
|
||||||
|
|
||||||
dom.toolGrid.addEventListener('click', (e) => {
|
dom.toolGrid.addEventListener('click', (e) => {
|
||||||
// @ts-expect-error TS(2339) FIXME: Property 'closest' does not exist on type 'EventTa... Remove this comment to see the full error message
|
// @ts-expect-error TS(2339) FIXME: Property 'closest' does not exist on type 'EventTa... Remove this comment to see the full error message
|
||||||
|
|||||||
Reference in New Issue
Block a user