Layout: Layout shift - inner components are rendered before the layout
See original GitHub issueDescribe the bug Inner components in layout can be rendered ahead of the layout itself causing layout shift.
Reproducer
Main xhtml:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:head>
<title>PrimeFaces Test</title>
</h:head>
<h:body>
<pe:layout fullPage="false">
<pe:layoutPane position="west">
<div style="background:red;width:100%">test</div>
<p:inputText value="West Text" style="width:100%"/>
</pe:layoutPane>
<pe:layoutPane position="center">
<p:inputText value="Main Text" style="width:100%"/>
</pe:layoutPane>
</pe:layout>
</h:body>
</html>
Environment:
- PF Version: 10.0
To Reproduce Steps to reproduce the behavior:
mvn clean jetty:run
- Go to http://localhost:8080/primefaces-test/
- Refresh the page and see if there’s flickering
Expected behavior The layout should be rendered before the inner components, layout shift shouldn’t happen.
As a closer look, we can see at some point the layout hasn’t been rendered yet while the inner components are rendered before the layout. Let’s see if this is a known issue or there’s something I missed 👀 .
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Cumulative Layout Shift (CLS) - web.dev
A layout shift occurs any time a visible element changes its position from one rendered frame to the next. (See below for details...
Read more >3 Ways To Fix Cumulative Layout Shift | by Robin Alaerts
A layout shift is defined by an element within the viewport that changes its starting position in the default writing mode between two...
Read more >Why other components does not render inside of Layout in ...
1 Answer 1 · margin-top shifts the whole page except navbar to 60px below the nav. My problem is that Footer is before...
Read more >Cumulative Layout Shift: Measure and Avoid Visual Instability
Cumulative Layout Shift measures how much elements move unexpectedly during a page view session, until there's a five second window of no ...
Read more >Cumulative Layout Shift, The Layout Instability Metric
Conclusion. Cumulative Layout Shift is a metric that measures the layout instabilities of a web page. To optimize it, and improve the user ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
8.0.5 is now in Maven Central
I think we made the better fix here: https://github.com/primefaces-extensions/primefaces-extensions/issues/563