React PDF viewer v2.11.0 Release Notes
-
๐ New features
- โ
The
Button
component has newtestId
property that is identical with thedata-testid
attribute - ๐ The Scroll Mode plugin provides new function to switch mode programmatically:
const scrollModePluginInstance = scrollModePlugin(); const { switchScrollMode } = scrollModePluginInstance; // Switch to Wrapped mode switchScrollMode(ScrollMode.Wrapped);
๐ You might find it useful when using with the full screen plugin. The following sample code switches the scroll mode after entering the full screen mode:
const defaultLayoutPluginInstance = defaultLayoutPlugin({ toolbarPlugin: { fullScreenPlugin: { onEnterFullScreen: (zoom) => { zoom(SpecialZoomLevel.PageFit); defaultLayoutPluginInstance.toolbarPluginInstance.scrollModePluginInstance.switchScrollMode( ScrollMode.Wrapped ); }, onExitFullScreen: (zoom) => { zoom(SpecialZoomLevel.PageWidth); defaultLayoutPluginInstance.toolbarPluginInstance.scrollModePluginInstance.switchScrollMode( ScrollMode.Horizontal ); }, }, }, });
๐ Improvements
- ๐ Cache pages' labels. So we won't see blink in the current page label when navigating between pages
- Keep the file name when downloading a file opened from local
- ๐ It's possible to remove the sidebar created by the default layout plugin:
const defaultLayoutPluginInstance = defaultLayoutPlugin({ sidebarTabs: () => [], });
๐ Bug fixes
- Can't use special characters such as
(
,)
,[
,]
,*
in the keyword - Downloading document doesn't work on iOS Safari and iOS Chrome
- ๐ The Get File plugin doesn't work with a file which is opened with credentials
- The highlight area aren't displayed
- The
selectedText
prop ofRenderHighlightContentProps
isn't correct
- โ
The