Skip to content

Sticky component loops forever if background-color is not set for page #3776

Description

@trsvax

Bug Report

  • Package version(s): 5.37.0
  • Browser and OS versions: NA

Priorities and help requested (not applicable if asking question):

Are you willing to submit a PR to fix? Yes

Requested priority: Normal

Products/sites affected: (if applicable)

Describe the issue:

Sticky component loops forever if background-color is not set for page

Actual behavior:

This loop in _getBackground() never exits

while (window.getComputedStyle(curr).getPropertyValue('background-color') === 'rgba(0, 0, 0, 0)' ||
window.getComputedStyle(curr).getPropertyValue('background-color') === 'transparent') {
if (curr.parentElement) {
curr = curr.parentElement;
}
}

Expected behavior:

Should check for curr == html and return

If applicable, please provide a codepen repro:

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions