Skip to content

A combination of absolute and relative positioning within a clipped element causes false negatives when checking visibility #33779

@TimVee

Description

@TimVee

Current behavior

A combination of elements with CSS position set to absolute and relative positioning within an element with overflow: clip element causes false negatives when checking visibility.

Desired behavior

The visibility should be detected correctly.

Test code to reproduce

The tested page:

<!doctype html>
<html lang="en">
  <body>
    <div style="overflow-y: clip">
      <div style="position: absolute">
        <div style="position: relative">
          <input />
        </div>
      </div>
    </div>
  </body>
</html>

The test:

describe('bug', () => {
  it('bug', () => {
    cy.visit('page');
    cy.get('input').type('test');
  });
});

The input is visible and can be used manually, but the test fails because the input is a descendant of a clipped element, despite the absolute and relative positioning escaping the clip.

Cypress Version

15.14.1

Debug Logs

Other

No response

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