File tree Expand file tree Collapse file tree 1 file changed +22
-6
lines changed
packages/ui-color-picker/src/ColorPreset Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -266,9 +266,11 @@ class ColorPreset extends Component<ColorPresetProps, ColorPresetState> {
266266 cursor = { this . props . disabled ? 'not-allowed' : 'auto' }
267267 as = "button"
268268 { ...( selectOnClick ? { onClick : ( ) => this . props . onSelect ( color ) } : { } ) }
269- { ...( this . isSelectedColor ( color )
270- ? { 'aria-label' : color + ' selected' }
271- : { 'aria-label' : color } ) }
269+ { ...{
270+ 'aria-label' : `${ color } ${
271+ this . isSelectedColor ( color ) ? ' selected' : ''
272+ } `
273+ } }
272274 >
273275 < div >
274276 < ColorIndicator color = { color } shape = "rectangle" role = "presentation" />
@@ -284,9 +286,23 @@ class ColorPreset extends Component<ColorPresetProps, ColorPresetState> {
284286 </ View >
285287 )
286288
287- renderIndicatorTooltip = ( child : React . ReactElement , color : string ) => (
288- < Tooltip renderTip = { < div > { color } </ div > } > { child } </ Tooltip >
289- )
289+ renderIndicatorTooltip = ( child : React . ReactElement , color : string ) => {
290+ return (
291+ < Tooltip
292+ renderTip = { < div > { color } </ div > }
293+ elementRef = { ( element ) => {
294+ if (
295+ element &&
296+ element . firstElementChild instanceof HTMLButtonElement
297+ ) {
298+ element . firstElementChild . removeAttribute ( 'aria-describedby' )
299+ }
300+ } }
301+ >
302+ { child }
303+ </ Tooltip >
304+ )
305+ }
290306
291307 renderSettingsMenu = ( color : string , index : number ) => (
292308 < Drilldown
You can’t perform that action at this time.
0 commit comments