MethodAddtControls

 
 
 
 

Overview

Overflow and z‑index controls for fine‑tuning block stacking and clipping behavior, wrapped in a ToolsPanel.

  • File: lib/blocks/components/MethodAddtControls.js
  • Panel label: “Additional Options” (customizable via label prop)

Props

PropTypeDefaultDescription
breakpointstring(required)The responsive breakpoint to read/write: base, mobile, tablet, or wide
attributesobject(required)The block’s full attributes object
setAttributesfunction(required)WordPress setAttributes function
labelstring'Additional Options'Custom label for the ToolsPanel heading
includestring[]['overflow', 'zIndex', 'hide']Which controls to render. Options: overflow, zIndex, hide

Controls

Overflow

  • UI: SelectControl dropdown.
  • Settings key: responsiveSettings.{breakpoint}.overflow
OptionValueDescription
VisiblevisibleContent is not clipped (default CSS behavior)
HiddenhiddenContent is clipped with no scrollbars
ScrollscrollContent is clipped with scrollbars always visible
AutoautoScrollbars appear only when content overflows
ClipclipContent is clipped at the element’s overflow clip edge

Z‑Index

  • UI: NumberControl (experimental) with shift‑step of 10 for quick large adjustments.
  • Settings key: responsiveSettings.{breakpoint}.zIndex
  • Value type: integer (parsed via parseInt on change)

The shiftStep of 10 means holding Shift while pressing the up/down arrows increments by 10 instead of 1, making it fast to jump between stacking layers.


Visibility

  • Settings key: responsiveSettings.{breakpoint}.hide
  • UI: ToolsPanel item “Visibility” with a Hide ToggleControl
  • CSS: display: none; visibility: hidden at that breakpoint, from both method_get_block_css_declarations() and MethodStyleTag
  • Meant for the responsive tabs: blocks pass include={['hide']} there so an item can be hidden on one tier while the base stays visible.

ToolsPanel Behavior

  • Overflow onSelect: Initializes to 'visible'
  • Overflow onDeselect: Removes the overflow key entirely from the breakpoint settings
  • Z‑Index onSelect: Initializes to 0
  • Z‑Index onDeselect: Removes the zIndex key entirely
  • resetAll: Removes both overflow and zIndex from the breakpoint

CSS Output

When consumed by MethodStyleTag, the settings keys map to CSS properties:

Settings KeyCSS Property
overflowoverflow
zIndexz-index

Usage by Blocks

BlockIncluded ControlsCustom Label
SectionzIndex
Containeroverflow, zIndex
Basic Grid Itemhidemobile, tablet, wide tabs
Advanced Grid Columnhidemobile, tablet, wide tabs
Flex Itemhidemobile, tablet, wide tabs

Changelog

VersionDescription
2.0.0-beta5Introduced, for the Container (overflow, z-index) and Section (z-index) blocks (1a17d90).
2.0.0-beta15hide option — the Visibility item with a Hide toggle — opt-in through include and in the default; wired up first on Basic Grid Item (a67fd5b).
2.0.0-beta17Hide wired up for Flex Item and Advanced Grid Column (60b9b07, b4c7dcb).