Skip to content

Commit

Permalink
Disable context-menu for web target in pages view
Browse files Browse the repository at this point in the history
  • Loading branch information
tnajdek authored and mrtcode committed Aug 21, 2023
1 parent 24db3f4 commit 407291d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/common/components/sidebar/thumbnails-view.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { Fragment, useState, useCallback, useEffect, useRef, useImperativeHandle } from 'react';
import React, { Fragment, useState, useCallback, useContext, useEffect, useRef, useImperativeHandle } from 'react';
import { useIntl } from 'react-intl';
import cx from 'classnames';
import { pressedNextKey, pressedPreviousKey } from '../../lib/utilities';
import { ReaderContext } from '../../reader';

function Thumbnail({ thumbnail, selected, pageLabel, onContextMenu }) {
return (
Expand All @@ -25,6 +26,7 @@ function ThumbnailsView(props) {
const intl = useIntl();
const [selected, setSelected] = useState([0]);
const containerRef = useRef();
const { platform } = useContext(ReaderContext);

useEffect(() => {
if (selected.length <= 1) {
Expand Down Expand Up @@ -171,6 +173,9 @@ function ThumbnailsView(props) {
}

function handleContextMenu(event) {
if (platform === 'web') {
return;
}
event.preventDefault();
props.onOpenThumbnailContextMenu({
x: event.clientX,
Expand Down

0 comments on commit 407291d

Please sign in to comment.