pl-fe: allow accessing 'load more' button with hotkeys
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@@ -29,7 +29,7 @@ const ConversationsList: React.FC = () => {
|
||||
|
||||
const handleMoveDown = (id: string) => {
|
||||
const elementIndex = getCurrentIndex(id) + 1;
|
||||
selectChild(elementIndex, ref, document.getElementById('direct-list') || undefined);
|
||||
selectChild(elementIndex, ref, document.getElementById('direct-list') || undefined, conversations.length);
|
||||
};
|
||||
|
||||
const handleLoadOlder = debounce(() => {
|
||||
|
||||
@@ -254,15 +254,15 @@ const Thread = ({
|
||||
const handleMoveDown = (id: string) => {
|
||||
const modalOffset = isModal ? 1 : 0;
|
||||
if (id === status.id) {
|
||||
selectChild(statusIndex + 1 + modalOffset, scroller, node.current || undefined);
|
||||
selectChild(statusIndex + 1 + modalOffset, scroller, node.current || undefined, thread.length + modalOffset);
|
||||
} else {
|
||||
let index = thread.indexOf(id);
|
||||
|
||||
if (index === -1) {
|
||||
index = thread.indexOf(id);
|
||||
selectChild(index + modalOffset, scroller, node.current || undefined);
|
||||
selectChild(index + modalOffset, scroller, node.current || undefined, thread.length + modalOffset);
|
||||
} else {
|
||||
selectChild(index + 1 + modalOffset, scroller, node.current || undefined);
|
||||
selectChild(index + 1 + modalOffset, scroller, node.current || undefined, thread.length + modalOffset);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user