Skip to content

Commit

Permalink
add tooltip to each icon in icon picker
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiankaegy committed Aug 4, 2023
1 parent dd6581a commit c9ffc98
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions components/icon-picker/icon-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
CheckboxControl,
BaseControl,
NavigableMenu,
VisuallyHidden,
SearchControl,
Tooltip,
} from '@wordpress/components';
import { useInstanceId } from '@wordpress/compose';
import { useState, memo, useMemo } from '@wordpress/element';
Expand Down Expand Up @@ -113,15 +113,16 @@ IconPicker.propTypes = {
const IconLabel = (props) => {
const { icon, isChecked } = props;
return (
<>
<StyledIconButton
selected={isChecked}
key={icon.name}
name={icon.name}
iconSet={icon.iconSet}
/>
<VisuallyHidden>{icon.label}</VisuallyHidden>
</>
<Tooltip text={icon.label}>
<div>
<StyledIconButton
selected={isChecked}
key={icon.name}
name={icon.name}
iconSet={icon.iconSet}
/>
</div>
</Tooltip>
);
};

Expand Down

0 comments on commit c9ffc98

Please sign in to comment.