Skip to content

IntersectionObserver sorts small thresholds lexicographically #58244

Description

@OskarEichler

Description

Both standard threshold and React Native rnRootThreshold arrays use JavaScript default .sort(), which compares their string forms. Valid small values written in exponential notation can therefore remain out of numeric order; for example [0.000001, 1e-7] is returned unchanged.

Expected behavior

Both exposed threshold arrays should be sorted in numerically ascending order as required by IntersectionObserver normalization.

React Native Version

0.87.1 and current main

Affected Platforms

New Architecture - All

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions