microsoft-search / pnp-modern-search

Home of PnP Modern Search solutions, helping you move from classic to modern SharePoint and beyond
https://microsoft-search.github.io/pnp-modern-search
Other
388 stars 341 forks source link

PnP-filepreview impacting page scroll position? #4013

Open renwein opened 1 month ago

renwein commented 1 month ago

Version used Ex: 4.13.1.0

Describe the bug I upgraded from version 4.10.2.0 to version 4.13.1.0 last Friday. We are using several Search Result web parts with SharePoint Search and the Handlebars/HTML list layout across our environment, and since upgrading, we are seeing some odd behavior with the pnp-filepreview feature.

The file preview pane opens just fine, but upon closing the preview pane, the page automatically jumps to the top as though closing the file preview pane is somehow impacting the page scroll position. The behavior is occurring across all sites where the web parts are utilized. This was not occurring previously, and no changes to the web part configuration have occurred.

To Reproduce Detailed steps to reproduce the behavior:

  1. Configure the Search Results web part with the Handlebars/HTML list layout in a SharePoint site page
  2. Click on the preview image in the search results web part
  3. Close the preview pane using the X in the upper right corner
  4. Page jumps to the top if viewing a result lower down the page

Expected behavior The file preview pane should close without changing the page scroll position; the user should still see the result they were viewing upon close.

Screenshots PreviewJump

Desktop (please complete the following information):

Additional context Add any other context about the problem here.