这是indexloc提供的服务,不要输入任何密码
Skip to content

turbo-refresh-scroll = reset is only honored on HTTP status 2XX #1449

@zzeligg

Description

@zzeligg

When performing a turbo visit by clicking any link, if the response HTTP status code returned is anything but a 2XX level, the refresh-scroll attribute, set via a meta tag as follows, is not honored.

<meta name="turbo-refresh-scroll" content="reset">

I tested with 3XX, 4XX and 5XX statuses and all cause the scroll reset to be ignored. Only 2XX works.

That is, if the current page has been scrolled, and contains a link to a controller returning 404, which in turn displays a (shorter) friendly message, the scroll offset remains the same, making the 404 message non visible unless one scrolls all the way back up.

Is that intended behavior, and if so, what is the rationale for it?

I would expect the scroll reset to work whatever the response HTTP status code is.

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