File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,10 @@ export const InlineSearch = () => {
154154 ` ;
155155 iframeDoc .head .appendChild (style );
156156
157+ // Show iframe now that CSS is injected (eliminates FOUC)
158+ iframe .style .visibility = ' visible' ;
159+ iframe .style .opacity = ' 1' ;
160+
157161 // Intercept all link clicks and navigate parent window
158162 const handleLinkClick = (e ) => {
159163 const link = e .target .closest (' a' );
@@ -187,6 +191,11 @@ export const InlineSearch = () => {
187191 });
188192 } catch (e ) {
189193 console .error (' Cannot inject styles into iframe:' , e );
194+ // Show iframe even on error to avoid permanent blank state
195+ if (iframe ) {
196+ iframe .style .visibility = ' visible' ;
197+ iframe .style .opacity = ' 1' ;
198+ }
190199 }
191200 };
192201
@@ -298,7 +307,10 @@ export const InlineSearch = () => {
298307 style = { {
299308 width: ' 100%' ,
300309 height: ' 100%' ,
301- border: ' none'
310+ border: ' none' ,
311+ visibility: ' hidden' ,
312+ opacity: ' 0' ,
313+ transition: ' opacity 0.15s ease-in-out'
302314 }}
303315 title = " Search Documentation"
304316 />
You can’t perform that action at this time.
0 commit comments