Skip to content

inview.js doesn't check computed styles #1873

Description

@danielstorey

I came across an issue where I was unable to complete a text component within a trickle article due to the fact that setCompletionStatus was called whilst inview but _isVisible === false on the model.

The result was that the model was not set as complete but the inview listener was removed meaning the setCompletionStatus could never get called again and the component could never be completed.

inview.js only checks an element's style attribute but not computed style, meaning isVisible will be passed as true when the element (or parent) has the .visibility-hidden class.

I suggest we alter the checks to use getComputedStyle instead in the lines below

https://github.com/adaptlearning/adapt_framework/blob/master/src/core/js/libraries/inview.js#L507-L518

Metadata

Metadata

Assignees

Labels

No labels
No labels

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