Skip to content

Sticky column native#180

Merged
davidperezgar merged 5 commits into
trunkfrom
sticky-column-native
Jun 3, 2026
Merged

Sticky column native#180
davidperezgar merged 5 commits into
trunkfrom
sticky-column-native

Conversation

@Castellon-ACM
Copy link
Copy Markdown
Contributor

@Castellon-ACM Castellon-ACM commented May 29, 2026

Summary

Extends the Sticky Column feature to the native core/columns block, previously only available for generateblocks/grid.

Changes

  • JSX editor panel (frontblocks-sticky-column-option.jsx): Added core/columns to SUPPORTED_BLOCKS array; block name checks updated throughout to use the array.
  • JS frontend (frontblocks-sticky-column.js): Rewrote the sticky implementation from scroll-event-based class toggling to applying position: sticky directly via inline styles. Uses :scope > .gb-grid-column, :scope > .wp-block-column selector to target child columns. For native wp-block-columns, creates a .frontblocks-sticky-inner wrapper div around all children and sets wrapper.style.alignItems = 'flex-start' to prevent stretch alignment from breaking sticky behaviour.
  • CSS (frontblocks-sticky-column.css): Removed class-based sticky rules. Simplified to a single mobile override using position: relative !important for both .gb-grid-column .gb-container and .wp-block-column.
  • PHP render (StickyColumn.php): Added add_sticky_attributes_to_columns_block() delegating to the shared add_sticky_attributes() helper; added register_sticky_attributes_for_columns_block() via register_block_type_args to register frblStickyEnabled, frblStickyOffset, and frblStickyColumnIndex on core/columns.
Open WordPress Playground Preview

@Castellon-ACM Castellon-ACM linked an issue Jun 3, 2026 that may be closed by this pull request
6 tasks
@davidperezgar
Copy link
Copy Markdown
Contributor

Fix the conflict before merge

@davidperezgar davidperezgar merged commit a82ad22 into trunk Jun 3, 2026
2 checks passed
@davidperezgar davidperezgar deleted the sticky-column-native branch June 3, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Sticky Column in Native Blocks

2 participants