Skip to content

inview fullscreen elements #661

@danielghost

Description

@danielghost

When an element goes fullscreen it can negatively affect the returned onscreen mesurement for the listeners, as the window.scrollY position seems to change. It is possible for an item to report that it isn't inview as it comes out of fullscreen (although this may be due to it actually being offscreen due to the scrollY change), as the following only ignores it being out of bounds if not fullscreen:

const isElementFullscreen = element === document.fullscreenElement;
if (isOutOfBound && !isElementFullscreen) {
onscreen = false;

Does it also make sense to expand the current fullscreen check to account for the possibility of an observed element containing a descendant that is the document.fullscreenElement?

const hasFullscreenDescendant = element.contains(document.fullscreenElement);

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Assigned

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions