How do I disable changing the page when tapping the page edges?

By default, when using the NutrientViewer.ScrollMode PER_SPREAD, tapping the edges of a page will navigate to the next or previous page. To disable this behavior, use the following workaround to ignore those touch events:

instance.contentDocument.addEventListener(
"click",
function (event) {
if (
instance.contentDocument
.querySelector(".PSPDFKit-Viewport")
.contains(event.target) &&
!event.target.closest(".PSPDFKit-Page")
) {
event.stopImmediatePropagation();
}
},
{ capture: true }
);