How to Remove the Scrollbar from a SharePoint Page Iframe
Question details
The user wants to eliminate the vertical scrollbar that appears on a document library embedded within a modern SharePoint page.

- Product
- Microsoft SharePoint
- Device & OS
- not provided
- Scenario
- Embedding a document library into a modern SharePoint page using a web part.
- Observed behavior
- A vertical scrollbar appears inside the iframe, creating a nested scrolling effect that disrupts the visual layout of the page.
Ensure you have at least Edit permissions for the modern SharePoint page where the document library web part is located.
Enable Autosize in Web Part Settings
Configure the document library web part to automatically adjust its height based on the number of files it contains.
This built-in method resolves the nested scrollbar issue for smaller document libraries. By setting the web part to automatically scale, SharePoint adjusts the iframe height so all items are visible without requiring an internal scrollbar.
Navigate to your modern SharePoint page and click the 'Edit' button located at the top right corner of the screen.
Click anywhere inside the document library web part that displays the scrollbar, then select the 'Edit web part' (pencil icon) from the floating toolbar on its left.
In the property pane that opens on the right side of the screen, scroll down to the 'Size' section and select the 'Autosize' option.
Close the property pane and click 'Republish' (or 'Save as draft') at the top right of the page to apply your changes to the live site.

Enhance Your Document Collaboration with WPS Office
While you manage files within SharePoint libraries, having a reliable desktop office suite is essential for heavy editing. WPS Office is a lightweight, fully compatible alternative to Microsoft Office that lets you view, edit, and collaborate on your documents seamlessly without a costly subscription.
- 1. Download the installer: Visit the official WPS Office website and click the free download button for your operating system.
- 2. Install the application: Run the downloaded installation file and follow the simple on-screen instructions to set up WPS Office on your computer.
- 3. Open your SharePoint documents: Sync your SharePoint libraries locally using OneDrive and open any Word, Excel, or PowerPoint file directly within WPS Office.

Frequently Asked Questions
Why does the scrollbar still appear after enabling Autosize in SharePoint?
If your document library contains more than 40 items, SharePoint automatically overrides the Autosize setting and displays a scrollbar. This is a built-in limitation designed to prevent excessive page lengths and maintain overall page loading performance.
Can I permanently hide the scrollbar for large SharePoint document libraries?
Using out-of-the-box SharePoint settings, the scrollbar cannot be removed for libraries exceeding 40 files. Achieving this requires creating a custom SharePoint Framework (SPFx) web part or using a third-party application that injects custom CSS into the modern page.
Does setting a fixed height fix the scrollbar issue?
Selecting 'Medium' or 'Large' size options gives the web part a fixed height. This might temporarily hide the scrollbar if the current file count fits within that specific height, but the scrollbar will immediately return once new files are added that push the content beyond the fixed boundary.




