Skip to content

Commit

Permalink
Editor: remove deprecated isPressed prop in WP 6.5. (#36318)
Browse files Browse the repository at this point in the history
* Editor: remove deprecated isPressed prop in WP 6.5.

The isPressed prop is deprecated in WP 6.5, and replaced by the native aria-pressed attribute.

WordPress/gutenberg#54740

* Update version

* Bump version
  • Loading branch information
jeherve authored Apr 26, 2024
1 parent eeab523 commit adace6c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Update button's prop to match latest changes in WordPress 6.5.
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ export default function VideoPressEdit( {
}
} }
icon={ captionIcon }
isPressed={ showCaption }
aria-pressed={ showCaption }
label={ showCaption ? removeCaptionLabel : addCaptionLabel }
/>

Expand Down
4 changes: 4 additions & 0 deletions projects/plugins/jetpack/changelog/update-button-aria-pressed
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Block Editor: update button props to match latest changes in WordPress 6.5.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function ViewSelector( props ) {
selectAction( optionDefinition );
} }
className="components-tab-button"
isPressed={ isSelected }
aria-pressed={ isSelected }
key={ `jetpack-premium-content-tab-${ optionDefinition.id }` }
>
<span>{ optionDefinition.label }</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function AiExcerptControl( {
label={ __( 'Advanced AI options', 'jetpack' ) }
icon={ aiAssistantIcon }
onClick={ toggleSetting }
isPressed={ isSettingActive }
aria-pressed={ isSettingActive }
isSmall
/>
</BaseControl>
Expand Down

0 comments on commit adace6c

Please sign in to comment.