diff --git a/packages/edit-site/src/components/global-styles/font-library-modal/font-collection.js b/packages/edit-site/src/components/global-styles/font-library-modal/font-collection.js index 5f6977ef7df74..01f7a90357c8b 100644 --- a/packages/edit-site/src/components/global-styles/font-library-modal/font-collection.js +++ b/packages/edit-site/src/components/global-styles/font-library-modal/font-collection.js @@ -58,6 +58,7 @@ const DEFAULT_CATEGORY = { }; const LOCAL_STORAGE_ITEM = 'wp-font-library-google-fonts-permission'; +const MIN_WINDOW_HEIGHT = 500; function FontCollection( { slug } ) { const requiresPermission = slug === 'google-fonts'; @@ -143,7 +144,8 @@ function FontCollection( { slug } ) { // NOTE: The height of the font library modal unavailable to use for rendering font family items is roughly 417px // The height of each font family item is 61px. - const pageSize = Math.floor( ( window.innerHeight - 417 ) / 61 ); + const windowHeight = Math.max( window.innerHeight, MIN_WINDOW_HEIGHT ); + const pageSize = Math.floor( ( windowHeight - 417 ) / 61 ); const totalPages = Math.ceil( fonts.length / pageSize ); const itemsStart = ( page - 1 ) * pageSize; const itemsLimit = page * pageSize;