Skip to content

Commit

Permalink
hotkey fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hellno committed Sep 25, 2023
1 parent 1b050e5 commit 9592914
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/common/components/NewPostEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default function NewPostEntry({ draftIdx, onPost, hideChannel }: NewPostE
}
}

const ref = useHotkeys('meta+enter', onSubmitPost, [draft]);
const ref = useHotkeys('meta+enter', onSubmitPost, [draft], { enableOnFormTags: true });

// const listener = (event: KeyboardEvent) => {
// if (event.key === "Enter" && event.metaKey) {
Expand Down
3 changes: 2 additions & 1 deletion src/common/components/SelectableListWithHotkeys.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ export const SelectableListWithHotkeys = ({ data, renderRow, selectedIdx, setSel
useHotkeys(['o', Key.Enter], () => {
onSelect(selectedIdx);
}, [selectedIdx], {
enabled: isActive
})

useHotkeys('shift+o', () => {
onExpand(selectedIdx);
}, [selectedIdx], {
enabled: onExpand !== undefined
enabled: onExpand !== undefined && isActive
})

useHotkeys(['j', Key.ArrowDown], () => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Feed/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export default function Feed() {
renderRow={(item: any, idx: number) => renderRow(item, idx)}
onExpand={onOpenLinkInCast}
onSelect={onSelectCast}
disableScroll={showCastThreadView || showReplyModal || showEmbedsModal}
isActive={!(showCastThreadView || showReplyModal || showEmbedsModal)}
/>
)

Expand Down

0 comments on commit 9592914

Please sign in to comment.