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
- Enable the field group module
- Create a content type
- Create some fields
- Add the "Tabs" and "Tab" Field Groups to your "Default" display, then nest them appropriately
- Nest some fields in the Tab field groups
- Create a node from your new content type with content in the fields that display in the tabs
- Now load the browser at 700px wide, then change the dimension below 640px
- Now load the browser at 500px wide, then change the dimension above 640px
- 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.