Skip to content

Commit 8aa1186

Browse files
author
Nagesh Pai
committed
Improvements via Copilot review
1 parent 84b70e8 commit 8aa1186

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

assets/infotip/infotip-web-component.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class BlaBlaBlocksInfotip extends HTMLElement {
193193
clip-rule="evenodd"
194194
/>`,
195195
};
196-
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
196+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" role="img">
197197
${ iconPaths[ iconType ] }
198198
</svg>`;
199199
}
@@ -206,7 +206,7 @@ class BlaBlaBlocksInfotip extends HTMLElement {
206206
${ this.renderStyle() }
207207
</style>
208208
<span class="wrapper">
209-
<span class="text" tabindex="0" aria-describedby="infotip-popover">
209+
<span class="text" tabindex="0" role="button" aria-describedby="infotip-popover">
210210
<span class="icon"></span>
211211
<slot></slot>
212212
</span>

src/infotip/inline-ui.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
info,
2828
notAllowed,
2929
starEmpty,
30+
update,
3031
} from '@wordpress/icons';
3132
import { PanelColorSettings } from '@wordpress/block-editor';
3233
import { useSelect } from '@wordpress/data';
@@ -202,7 +203,9 @@ function IconTabContent( {
202203

203204
// Show the info icon enabled as a default when no icon type is set, and icons are just enabled.
204205
if ( iconEnabled && ! activeAttributes[ 'icon-type' ] ) {
205-
activeAttributes[ 'icon-type' ] = 'info';
206+
updateAttributes( {
207+
'icon-type': 'info',
208+
} );
206209
}
207210

208211
return (
@@ -222,7 +225,7 @@ function IconTabContent( {
222225
<Button
223226
accessibleWhenDisabled={ true }
224227
disabled={ ! iconEnabled }
225-
key={ icon.label }
228+
key={ icon.id }
226229
icon={ icon.graphic }
227230
isPressed={
228231
activeAttributes[ 'icon-type' ] === icon.id

0 commit comments

Comments
 (0)