Skip to content

Commit

Permalink
Merge pull request #48 from GeoffreyChen777/electron-dev-quicklook-bug
Browse files Browse the repository at this point in the history
Electron quicklook bug.
  • Loading branch information
GeoffreyChen777 authored Mar 25, 2022
2 parents b15935e + c6447b5 commit d09da6e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
14 changes: 14 additions & 0 deletions src/pages/entities_view/EntitiesView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ export default defineComponent({
viewType.value = JSON.parse(message as string) as string;
});
function preventSpaceScrollEvent (event: KeyboardEvent) {
console.log(event)
if (event.code === 'Space') {
if (event.target instanceof HTMLInputElement) {
return true;
}
event.preventDefault()
if (props.selectedEntities?.length == 1) {
void window.entityInteractor.preview(props.selectedEntities[0].mainURL)
}
}
}
window.addEventListener('keydown', preventSpaceScrollEvent, true)
return {
viewType,
...toRefs(props),
Expand Down
6 changes: 0 additions & 6 deletions src/pages/toolbar_view/ToolbarView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,6 @@ Examples: <br/>
window.systemInteractor.setState('viewState.viewType', JSON.stringify(viewType));
};
window.systemInteractor.registerSignal('shortcutClicked-Space', () => {
if (props.selectedEntities.length == 1) {
void window.entityInteractor.preview(props.selectedEntities[0].mainURL)
}
});
window.systemInteractor.registerSignal('shortcutClicked-Enter', () => {
if (props.selectedEntities.length == 1) {
void window.entityInteractor.open(props.selectedEntities[0].mainURL);
Expand Down

0 comments on commit d09da6e

Please sign in to comment.