Skip to content

Tab buttons scroll back when turbo frames are lazy loaded #4613

Description

@Timmitry

Describe the bug

I'm using tabs on a show page. Inside the tabs are has_many fields. There are many tab buttons, so that a horizontal scrollbar appears. When I scroll to the right and press a tab button for the first time, the corresponding tabpanel appears and lazy loads the content. When this happens, the horizontal scroll on the tab buttons resets to the left, and I need to scroll back to the right.

This does not happen if the content was already loaded, e.g. when clicking for the second time on a button.

As a side note: When clicking a tab button on the far left or far right, a horizontal scroll is applied automatically, to make the next button visible. Even though I understand why this behaviour was added, I feel that it is rather a bit annoying, as I always have to check where I was before clicking the next button. I think it would be easier to click through the tabs if the horizontal scroll just stayed where it was 🙂

Reproduction repository for the bug

No repository, but mainly just this code:

        tabs do
          public_profile_panel
          personal_information_panel
          employee_information_panel
          bank_account_information_panel
          payroll_information_panel

          field :user_contract_details, as: :has_many, translation_key: "activerecord.models.user_contract_details"
          field :user_vehicles, as: :has_many, translation_key: "activerecord.models.user_vehicle"
          field :absences, as: :has_many, translation_key: "activerecord.models.absence"
          field :user_locations, as: :has_many, translation_key: "activerecord.models.user_location"
          field :user_equipments, as: :has_many, translation_key: "activerecord.models.user_equipment"
          field :project_teams, as: :has_many, translation_key: "activerecord.models.project_team.other"
        end

Expected behavior

I don't want the tab button list to move at all 😉

System configuration

Avo version: 4.0.0 beta 58

Rails version: 8.1

Ruby version: 4.0

License type:

  • Community
  • Pro
  • Advanced

Are you using Avo monkey patches, overriding views or view components?

  • Yes. If so, please post code samples.
  • No

Screenshots or screen recordings

Bildschirmaufnahme.2026-07-07.um.08.59.47.mov

Additional context

Impact

  • High impact (It makes my app un-usable.)
  • Medium impact (I'm annoyed, but I'll live.)
  • Low impact (It's really a tiny thing that I could live with.)

Urgency

  • High urgency (I can't continue development without it.)
  • Medium urgency (I found a workaround, but I'd love to have it fixed.)
  • Low urgency (It can wait. I just wanted you to know about it.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions