question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Layout: Layout shift - inner components are rendered before the layout

See original GitHub issue

Describe the bug Inner components in layout can be rendered ahead of the layout itself causing layout shift.

Reproducer

primefaces-test.zip

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:

  1. mvn clean jetty:run
  2. Go to http://localhost:8080/primefaces-test/
  3. 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 👀 .

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
mellowarecommented, Oct 7, 2021

8.0.5 is now in Maven Central

1reaction
mellowarecommented, Oct 6, 2021
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found