Apply more useKey: true

pull/1135/head
Lim Chee Aun 2025-05-03 09:36:00 +08:00
rodzic c619a7c6b3
commit 17c2390a5c
8 zmienionych plików z 231 dodań i 213 usunięć

Wyświetl plik

@ -519,6 +519,7 @@ function Compose({
{
enabled: !supportsCloseWatcher,
enableOnFormTags: true,
useKey: true,
},
);
useHotkeys(
@ -541,6 +542,7 @@ function Compose({
modals.length === 1 && modals[0].querySelector('#compose-container');
return hasModal && !hasOnlyComposer;
},
useKey: true,
},
);
useCloseWatcher(() => {
@ -3141,6 +3143,7 @@ function MentionModal({
{
preventDefault: true,
enableOnFormTags: ['input'],
useKey: true,
},
);
@ -3167,6 +3170,7 @@ function MentionModal({
{
preventDefault: true,
enableOnFormTags: ['input'],
useKey: true,
},
);
@ -3192,6 +3196,7 @@ function MentionModal({
{
preventDefault: true,
enableOnFormTags: ['input'],
useKey: true,
},
);

Wyświetl plik

@ -88,6 +88,7 @@ function MediaModal({
const hasModal = !!document.querySelector('#modal-container > *');
return hasModal;
},
useKey: true,
},
[onClose],
);

Wyświetl plik

@ -43,6 +43,7 @@ function Modal({ children, onClose, onClick, class: className, minimized }) {
// This will run "later" to prevent clash with esc handlers from other components
keydown: false,
keyup: true,
useKey: true,
},
[onClose],
);

Wyświetl plik

@ -45,6 +45,7 @@ export default memo(function SearchCommand({ onClose = () => {} }) {
enabled: showSearch,
enableOnFormTags: true,
preventDefault: true,
useKey: true,
},
);

Wyświetl plik

@ -262,7 +262,9 @@ function Timeline({
behavior: 'smooth',
});
}, [loadItems, showNewPostsIndicator]);
const dotRef = useHotkeys('.', handleLoadNewPosts);
const dotRef = useHotkeys('.', handleLoadNewPosts, {
useKey: true,
});
// const {
// scrollDirection,

418
src/locales/en.po wygenerowano

Plik diff jest za duży Load Diff

Wyświetl plik

@ -808,6 +808,7 @@ function Catchup() {
preventDefault: true,
ignoreModifiers: true,
enableOnFormTags: ['input'],
useKey: true,
},
);

Wyświetl plik

@ -644,12 +644,19 @@ function StatusThread({ id, closeLink = '/', instance: propInstance }) {
const hasModal = !!document.querySelector('#modal-container > *');
return hasModal;
},
useKey: true,
},
);
// For backspace, will always close both media and status page
useHotkeys('backspace', () => {
location.hash = closeLink;
});
useHotkeys(
'backspace',
() => {
location.hash = closeLink;
},
{
useKey: true,
},
);
useHotkeys(
'j',