Responsive Tabs Are Not Responsive

Created on 26 May 2023, over 1 year ago
Updated 6 September 2024, 5 months ago

Problem/Motivation

When using the Field Groups Tabs/Tab configuration in a display there is some functionality to change the visible elements to make it more small screen friendly that trigger only on page load or refresh below 640px. The problem is if you load the page on a screen less than 640px, then expand the screen dimensions by stretching a browser, flipping a device, etc. it does not detect that change in screen size and thus does not convert to the more friendly design for larger screens. This works the other way, if you shrink a browser window below 640px it does not convert to the more friendly mobile layout.

Steps to reproduce

  1. Enable the field group module
  2. Create a content type
  3. Create some fields
  4. Add the "Tabs" and "Tab" Field Groups to your "Default" display, then nest them appropriately
  5. Nest some fields in the Tab field groups
  6. Create a node from your new content type with content in the fields that display in the tabs
  7. Now load the browser at 700px wide, then change the dimension below 640px
  8. Now load the browser at 500px wide, then change the dimension above 640px
  9. Notice the 2 versions of tabs designed for different screen widths do not respond to the change in screen size


Sample Desktop

Sample Desktop Shrunk to Mobile

Sample Mobile

Sample Mobile Expanded to Desktop

Proposed resolution

I propose some sort of listener be added to change the mobile/desktop when the screen size passes the defined threshold of 640px to make the designed adjustment.

Remaining tasks

Write a patch, test it, commit it.

User interface changes

I think the UI is fine. I don't care for the design of the box with vertical padding and/or margin, but 0 padding, that contains the tabs in mobile, but that is easily fixed in a sub-theme. Maybe another issue for that.

API changes

None.

Data model changes

Not suggesting any at this time.

πŸ› Bug report
Status

Closed: duplicate

Version

3.4

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States anthorn305

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024