Skip to content

Closing <dialog> triggers unexpected network requests in v2.0.21 #778

@sebasfourn

Description

@sebasfourn

Description

After upgrading from v2.0.20 to v2.0.21, closing a <dialog> element triggers a Turbo Frame refetch of the underlying page content.

Steps to Reproduce

  1. Navigate to a page with Turbo Frames
  2. Open a modal dialog (using <dialog> with showModal())
  3. Close the dialog (via .close() or removing the element)
  4. Observe: The Turbo Frame refetches its content (and all associated assets)

Network Activity on Dialog Close

  • plans 200 fetch frame_ant.js:2
  • actiontext-.css 200 stylesheet
  • application-.css 200 stylesheet
  • ... (all page assets reload)

Expected Behavior

Closing a dialog should not trigger any Turbo Frame refetches.

Actual Behavior

The Turbo Frame refetches its src URL when the dialog is closed/removed.

Versions

  • turbo-rails: 2.0.21 (works correctly in 2.0.20)
  • Rails: 8.1.2
  • Browser: Chrome

Possible Cause

This may be related to #740 ("Include hidden elements for turbo-cable-stream-source selector").

Workaround

Pinning to gem "turbo-rails", "2.0.20" resolves the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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