react-pdf-viewer
react-pdf-viewer copied to clipboard
disabling shortcuts on page navigation not working.
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 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.
Done.