Skip to content

Anchor text content mismatch causes unwanted focus and page scroll #11824

Closed
@petrhanak

Description

@petrhanak

Do you want to request a feature or report a bug?

bug

What is the current behavior?

When server-side-rendered text content of anchor does not match, the anchor is focused causing page to scroll in all browsers.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Issue isolated here (ssr necessary)
https://github.com/petrhanak/react16-anchor-bug

What is the expected behavior?

Button should not be focused

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

React 15 ok
React 16 broken
Reproducible in latest Safari, Chrome or Firefox (and probably others)

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