Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Turbo] InstantClick should not prefetch links from Web Debug Toolbar #1520

Copy link
Copy link
Closed
@davidgorges

Description

@davidgorges
Issue body actions

Turbo 8 comes with InstantClick by default. This prefetches links while the cursor is hovering, which is a nice feature.

The WebDebugToolbar intercepts Ajax calls, which include the prefetched requests via InstantClick and dynamically adds an entry to the Ajax menu. The makes it really hard to click on an entry.

Turbo8-Profiler.mp4

I think it would nice be to disable the prefetching for the WebDebugToolbar via data-turbo-prefetch="false" directly in the Profiler Bundle, but since it's Turbo specific I am not sure if that's the right place.

Another way would be to add an event listener to the turbo:before-prefetch event that checks if the prefetch event comes from the WebDebugToolbar, e.g.

    document.addEventListener("turbo:before-prefetch", (event) => {
        if (event.target.closest('.sf-toolbar') !== null) {
            event.preventDefault()
        }
    })

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.