react-pdf-viewer icon indicating copy to clipboard operation
react-pdf-viewer copied to clipboard

disabling shortcuts on page navigation not working.

Open kdv24 opened this issue 3 years ago • 1 comments

const pageNavigationPluginInstance = pageNavigationPlugin({
    enableShortcuts: false
});

I'm trying to disable the pageNavigation in certain situations, but using the above code, I'm unable to disable it at any time. Shouldn't this alone set the arrow shortcuts to be disabled?

kdv24 avatar Jul 07 '22 19:07 kdv24

@kdv24 The issue is fixed in the latest code, and will be included in the next release. The actual issue is that we can't set the enableShortcuts option when using the default layout plugin:

// Does not work with v3.6.0
const defaultLayoutPluginInstance = defaultLayoutPlugin({
    toolbarPlugin: {
        pageNavigationPlugin: {
            enableShortcuts: true,
        },
    },
});

It's worth noting that even if you set enableShortcuts: false, the content will scroll down/up when users pressing PageDown, PageUp keys. It's the default behavior of the browser, and we don't prevent that.

phuocng avatar Jul 31 '22 03:07 phuocng

Done.

phuocng avatar Sep 04 '22 02:09 phuocng