Skip to content

r-stack and r-stretch work on Firefox but not Chrome #3597

@alifeee

Description

@alifeee

Please see my reproduction (https://github.com/alifeee/revealjs-rstretch-bug) on http://alifeee.co.uk/revealjs-rstretch-bug/

Importantly, here is the markup of the problem slide:

        <section data-auto-animate>
          <h1 data-id="h1"><code>class="r-stack r-stretch"</code></h1>
          <p>
            Stack only. On Firefox, limits section to viewport. On Chrome,
            stretches off bottom of viewport :(
          </p>
          <div class="r-stack r-stretch">
            <img src="images/wide.png" alt="wide image" />
            <img src="images/tall.png" alt="tall image" />
          </div>
        </section>

Firefox

All is good

image

Chrome

All is not good (images stretch off the bottom)

image

Why?

I am not sure why. It seems a difference in how Firefox and Chrome deal with grid layout?

See the grid overlay here, and I have highlighted the div containing the images

Firefox

Div is sized correctly, and grid layout is the same size

image

Chrome

Div is sized correctly, but the grid layout overflows past this size

image

Research

After doing some research, I think I have found a fix. I will create a PR. I will also create this issue for people to find.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions