kopia lustrzana https://github.com/cheeaun/phanpy
Apply more useKey: true
rodzic
c619a7c6b3
commit
17c2390a5c
|
@ -519,6 +519,7 @@ function Compose({
|
||||||
{
|
{
|
||||||
enabled: !supportsCloseWatcher,
|
enabled: !supportsCloseWatcher,
|
||||||
enableOnFormTags: true,
|
enableOnFormTags: true,
|
||||||
|
useKey: true,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
useHotkeys(
|
useHotkeys(
|
||||||
|
@ -541,6 +542,7 @@ function Compose({
|
||||||
modals.length === 1 && modals[0].querySelector('#compose-container');
|
modals.length === 1 && modals[0].querySelector('#compose-container');
|
||||||
return hasModal && !hasOnlyComposer;
|
return hasModal && !hasOnlyComposer;
|
||||||
},
|
},
|
||||||
|
useKey: true,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
useCloseWatcher(() => {
|
useCloseWatcher(() => {
|
||||||
|
@ -3141,6 +3143,7 @@ function MentionModal({
|
||||||
{
|
{
|
||||||
preventDefault: true,
|
preventDefault: true,
|
||||||
enableOnFormTags: ['input'],
|
enableOnFormTags: ['input'],
|
||||||
|
useKey: true,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -3167,6 +3170,7 @@ function MentionModal({
|
||||||
{
|
{
|
||||||
preventDefault: true,
|
preventDefault: true,
|
||||||
enableOnFormTags: ['input'],
|
enableOnFormTags: ['input'],
|
||||||
|
useKey: true,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -3192,6 +3196,7 @@ function MentionModal({
|
||||||
{
|
{
|
||||||
preventDefault: true,
|
preventDefault: true,
|
||||||
enableOnFormTags: ['input'],
|
enableOnFormTags: ['input'],
|
||||||
|
useKey: true,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -88,6 +88,7 @@ function MediaModal({
|
||||||
const hasModal = !!document.querySelector('#modal-container > *');
|
const hasModal = !!document.querySelector('#modal-container > *');
|
||||||
return hasModal;
|
return hasModal;
|
||||||
},
|
},
|
||||||
|
useKey: true,
|
||||||
},
|
},
|
||||||
[onClose],
|
[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
|
// This will run "later" to prevent clash with esc handlers from other components
|
||||||
keydown: false,
|
keydown: false,
|
||||||
keyup: true,
|
keyup: true,
|
||||||
|
useKey: true,
|
||||||
},
|
},
|
||||||
[onClose],
|
[onClose],
|
||||||
);
|
);
|
||||||
|
|
|
@ -45,6 +45,7 @@ export default memo(function SearchCommand({ onClose = () => {} }) {
|
||||||
enabled: showSearch,
|
enabled: showSearch,
|
||||||
enableOnFormTags: true,
|
enableOnFormTags: true,
|
||||||
preventDefault: true,
|
preventDefault: true,
|
||||||
|
useKey: true,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -262,7 +262,9 @@ function Timeline({
|
||||||
behavior: 'smooth',
|
behavior: 'smooth',
|
||||||
});
|
});
|
||||||
}, [loadItems, showNewPostsIndicator]);
|
}, [loadItems, showNewPostsIndicator]);
|
||||||
const dotRef = useHotkeys('.', handleLoadNewPosts);
|
const dotRef = useHotkeys('.', handleLoadNewPosts, {
|
||||||
|
useKey: true,
|
||||||
|
});
|
||||||
|
|
||||||
// const {
|
// const {
|
||||||
// scrollDirection,
|
// scrollDirection,
|
||||||
|
|
Plik diff jest za duży
Load Diff
|
@ -808,6 +808,7 @@ function Catchup() {
|
||||||
preventDefault: true,
|
preventDefault: true,
|
||||||
ignoreModifiers: true,
|
ignoreModifiers: true,
|
||||||
enableOnFormTags: ['input'],
|
enableOnFormTags: ['input'],
|
||||||
|
useKey: true,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -644,12 +644,19 @@ function StatusThread({ id, closeLink = '/', instance: propInstance }) {
|
||||||
const hasModal = !!document.querySelector('#modal-container > *');
|
const hasModal = !!document.querySelector('#modal-container > *');
|
||||||
return hasModal;
|
return hasModal;
|
||||||
},
|
},
|
||||||
|
useKey: true,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
// For backspace, will always close both media and status page
|
// For backspace, will always close both media and status page
|
||||||
useHotkeys('backspace', () => {
|
useHotkeys(
|
||||||
|
'backspace',
|
||||||
|
() => {
|
||||||
location.hash = closeLink;
|
location.hash = closeLink;
|
||||||
});
|
},
|
||||||
|
{
|
||||||
|
useKey: true,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
useHotkeys(
|
useHotkeys(
|
||||||
'j',
|
'j',
|
||||||
|
|
Ładowanie…
Reference in New Issue