kopia lustrzana https://github.com/cheeaun/phanpy
Apply more useKey: true
rodzic
c619a7c6b3
commit
17c2390a5c
|
@ -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,
|
||||
},
|
||||
);
|
||||
|
||||
|
|
|
@ -88,6 +88,7 @@ function MediaModal({
|
|||
const hasModal = !!document.querySelector('#modal-container > *');
|
||||
return hasModal;
|
||||
},
|
||||
useKey: true,
|
||||
},
|
||||
[onClose],
|
||||
);
|
||||
|
|
|
@ -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],
|
||||
);
|
||||
|
|
|
@ -45,6 +45,7 @@ export default memo(function SearchCommand({ onClose = () => {} }) {
|
|||
enabled: showSearch,
|
||||
enableOnFormTags: true,
|
||||
preventDefault: true,
|
||||
useKey: true,
|
||||
},
|
||||
);
|
||||
|
||||
|
|
|
@ -262,7 +262,9 @@ function Timeline({
|
|||
behavior: 'smooth',
|
||||
});
|
||||
}, [loadItems, showNewPostsIndicator]);
|
||||
const dotRef = useHotkeys('.', handleLoadNewPosts);
|
||||
const dotRef = useHotkeys('.', handleLoadNewPosts, {
|
||||
useKey: true,
|
||||
});
|
||||
|
||||
// const {
|
||||
// scrollDirection,
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -808,6 +808,7 @@ function Catchup() {
|
|||
preventDefault: true,
|
||||
ignoreModifiers: true,
|
||||
enableOnFormTags: ['input'],
|
||||
useKey: true,
|
||||
},
|
||||
);
|
||||
|
||||
|
|
|
@ -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',
|
||||
|
|
Ładowanie…
Reference in New Issue