Skip to content

Commit

Permalink
Fix sticky position in classic themes with appearance tools support (#…
Browse files Browse the repository at this point in the history
…56743)

* Fix sticky position in classic themes with appearance tools support

* Remove editor setting to detect appearance tools support

* Delete unused file
  • Loading branch information
tellthemachines authored Dec 5, 2023
1 parent fc522ee commit 0e98444
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/block-editor/src/components/block-list/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ function BlockListBlock( {
!! wrapperProps[ 'data-align' ] &&
! themeSupportsLayout;

// Support for sticky position in classic themes with alignment wrappers.

const isSticky = className?.includes( 'is-position-sticky' );

// For aligned blocks, provide a wrapper element so the block can be
// positioned relative to the block column.
// This is only kept for classic themes that don't support layout
Expand All @@ -172,7 +176,7 @@ function BlockListBlock( {
if ( isAligned ) {
blockEdit = (
<div
className="wp-block"
className={ classnames( 'wp-block', isSticky && className ) }
data-align={ wrapperProps[ 'data-align' ] }
>
{ blockEdit }
Expand Down Expand Up @@ -221,7 +225,7 @@ function BlockListBlock( {
isTemporarilyEditingAsBlocks,
},
dataAlign && themeSupportsLayout && `align${ dataAlign }`,
className
! ( dataAlign && isSticky ) && className
),
wrapperProps: restWrapperProps,
isAligned,
Expand Down

1 comment on commit 0e98444

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 0e98444.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7107222634
📝 Reported issues:

Please sign in to comment.