Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui-color-picker): make ColorPicker tooltip VoiceOver focusable #1771

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions packages/ui-color-picker/src/ColorPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/** @jsxFrag React.Fragment */
import React, { Component } from 'react'

import { withStyle, jsx } from '@instructure/emotion'
import { withStyle, jsx, InstUISettingsProvider } from '@instructure/emotion'
import { warn, error } from '@instructure/console'
import { omitProps } from '@instructure/ui-react-utils'
import { testable } from '@instructure/ui-testable'
Expand Down Expand Up @@ -389,9 +389,19 @@ class ColorPicker extends Component<ColorPickerProps, ColorPickerState> {
<span>
<span css={styles?.label}>{label}</span>
<span>
<Tooltip renderTip={tooltip}>
<IconInfoLine tabIndex={-1} />
</Tooltip>
<InstUISettingsProvider
theme={{
componentOverrides: {
BaseButton: {
smallHeight: 'auto'
}
}
}}
>
<Tooltip renderTip={<span aria-hidden={true}>{tooltip}</span>}>
<IconButton withBackground={false} withBorder={false} screenReaderLabel={tooltip} size="small" shape="circle" width="auto" renderIcon={IconInfoLine}/>
</Tooltip>
</InstUISettingsProvider>
</span>
</span>
) : (
Expand Down
7 changes: 3 additions & 4 deletions packages/ui-svg-images/src/InlineSVG/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ class InlineSVG extends Component<InlineSVGProps> {
}

get labelledBy() {
const ids = []
const ids: string[] = []

if (this.props.title) {
ids.push(this.titleId)
ids.push(this.titleId as string)
}

if (this.props.description) {
ids.push(this.descId)
ids.push(this.descId as string)
}

return ids.length > 0 ? ids.join(' ') : undefined
Expand All @@ -150,7 +150,6 @@ class InlineSVG extends Component<InlineSVGProps> {
title,
description,
focusable,
children,
Copy link
Collaborator

Choose a reason for hiding this comment

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

why did you remove this?

src,
styles,
...props
Expand Down
Loading