Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: grid template areas are not inlined correctly by Chrome #1395

Open
1 task done
pauldambra opened this issue Jan 9, 2024 · 3 comments
Open
1 task done

[Bug]: grid template areas are not inlined correctly by Chrome #1395

pauldambra opened this issue Jan 9, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@pauldambra
Copy link
Contributor

Preflight Checklist

  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.

What package is this bug report for?

rrweb

Version

latest v2

Expected Behavior

that the grid-template-area is captured correctly

Actual Behavior

A customer site uses grid template areas in their CSS. When playing back we see the content is not aligned as expected. When viewing the working site things appear in the correct place.

On checking the captured CSS it does not match the source

The source has

#wrapper {
  display: grid;
    width: 100%;
    height: 100%;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: max-content;
    grid-template-areas:
        "header header"
        "main main"
        "footer footer";
    margin: 0px auto;
}

but the captured CSS has:

#wrapper { 
display: grid; 
width: 100%; 
height: 100%; 
grid-template: \"header header\" max-content / repeat(2, 1fr); 
margin: 0px auto; 
}

you can see the CSS has been collapsed to a short-hand grid-template and lost detail from the original

Steps to Reproduce

You can see a working example of this here: https://jsfiddle.net/pauldambra/oLtcrjm4/10/ showing that the captured CSS has been mangled

Testcase Gist URL

No response

Additional Information

No response

@pauldambra pauldambra added the bug Something isn't working label Jan 9, 2024
@pauldambra
Copy link
Contributor Author

ah, looking in safari and firefox. this is another Chrome is the IE8 of the new millenium since it seems correct in those other browsers 🤣

@pauldambra pauldambra changed the title [Bug]: grid template areas are not inlined correctly [Bug]: grid template areas are not inlined correctly by Chrome Jan 9, 2024
@debbyglance
Copy link

We are also impacted by this bug

@jaj1014
Copy link

jaj1014 commented Oct 21, 2024

Resurfacing that this is still an issue. We were using the fix from @pauldambra PR that was closed, but ran into an issue with the regex that solution used. I have opened another PR that tweaks the original to address the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants