Skip to content

PF4 BackgroundImage Error: <filter> attribute width: Unexpected end of attribute. Expected length, "" #2100

@idevat

Description

@idevat

When I tried to update @patternfly/react-core from 2.9.2 to current 3.16.10 the background image was shorten. I separated a reproducer:

import React from "react";
import { BackgroundImage, BackgroundImageSrc } from "@patternfly/react-core";
import b1200 from "@patternfly/patternfly/assets/images/pfbg_1200.jpg";
import b768 from "@patternfly/patternfly/assets/images/pfbg_768.jpg";
import b768x2x from "@patternfly/patternfly/assets/images/pfbg_768@2x.jpg";
import b576 from "@patternfly/patternfly/assets/images/pfbg_576.jpg";
import b576x2x from "@patternfly/patternfly/assets/images/pfbg_576@2x.jpg";
import filter from "@patternfly/patternfly/assets/images/background-filter.svg";

const BackgroundImageSources = {
  [BackgroundImageSrc.lg]: b1200,
  [BackgroundImageSrc.sm]: b768,
  [BackgroundImageSrc.sm2x]: b768x2x,
  [BackgroundImageSrc.xs]: b576,
  [BackgroundImageSrc.xs2x]: b576x2x,
  [BackgroundImageSrc.filter]: `${filter}#image_overlay`,
};

const Test = () => (
  <BackgroundImage src={BackgroundImageSources} />
);

export default Test;

With the previous version 2.9.2 the result page looks like this:
ver_2 9 2

With the new version 3.16.10 the result page looks like this (notice the white stripe between the image and the chrome dev tools area):
ver_3 16 10

Is something wrong with the code above?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions