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

Conversation

balzss
Copy link
Contributor

@balzss balzss commented Nov 13, 2024

Closes: INSTUI-4259

test plan:

  • check colorpicker example with tooltip if voiceover reads the tooltip context correctly

@balzss balzss requested review from matyasf and ToMESSKa November 13, 2024 15:30
@balzss balzss self-assigned this Nov 13, 2024
Copy link

github-actions bot commented Nov 13, 2024

PR Preview Action v1.4.8
Preview removed because the pull request was closed.
2024-11-29 14:41 UTC

Copy link
Collaborator

@matyasf matyasf left a comment

Choose a reason for hiding this comment

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

I dont like that the SR is focusing on nothing and the tooltip does not show with this solution.

I would solve the underlying issue, that icons set aria-hidden to true (in InlineSVG) by default. You just need a small change there to allow this attribute:

image

@balzss balzss force-pushed the fix/vo-announce-colorpicker-tooltip branch 2 times, most recently from ffb712f to c435fb6 Compare November 14, 2024 12:49
@balzss balzss requested a review from matyasf November 14, 2024 12:50
@balzss balzss force-pushed the fix/vo-announce-colorpicker-tooltip branch 2 times, most recently from d80a37b to b8650f4 Compare November 20, 2024 09:11
@balzss balzss force-pushed the fix/vo-announce-colorpicker-tooltip branch from b8650f4 to 7ddbc9f Compare November 22, 2024 21:14
@balzss
Copy link
Contributor Author

balzss commented Nov 22, 2024

@matyasf I've went with a different approach. According to w3c and mdn tooltips should be focusable with keyboard.

Copy link
Collaborator

@matyasf matyasf left a comment

Choose a reason for hiding this comment

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

I dont think this is a good solution. NVDA does not read the tooltip. Also its wonky on VO too, when I move the SR focus it does not read it, but after I've tabbed trough it, it will read it
I think its because the svg icon is set to aria-hidden which is a no for focusable elements https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden#description , so NVDA just removes is from the SR DOM

@balzss balzss force-pushed the fix/vo-announce-colorpicker-tooltip branch from 7ddbc9f to b986504 Compare November 27, 2024 15:03
@balzss balzss requested a review from matyasf November 27, 2024 15:15
@balzss
Copy link
Contributor Author

balzss commented Nov 28, 2024

@matyasf can you please check it again? now it also reads the tooltip when the input is focused but I don't think we can prevent that. I think it always reads the label when an input gets focused...

also fyi: it has a ts error that's probably introduced from this pr so a temporary ts-ignore was added

@@ -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?

Copy link
Collaborator

@matyasf matyasf left a comment

Choose a reason for hiding this comment

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

nice work!

Comment on lines 393 to 395
theme={{
themeOverrides: {
componentOverrides: {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I did not knew that this is a valid syntax... easier one would be

  theme={{
    componentOverrides: {
      BaseButton: {
        smallHeight: 'auto'
      }
    }
  }}

@balzss balzss force-pushed the fix/vo-announce-colorpicker-tooltip branch from b986504 to 6e529af Compare November 29, 2024 13:11
@balzss balzss force-pushed the fix/vo-announce-colorpicker-tooltip branch from 6e529af to a38ddad Compare November 29, 2024 13:11
@balzss balzss merged commit 610c0d8 into master Nov 29, 2024
11 checks passed
@balzss balzss deleted the fix/vo-announce-colorpicker-tooltip branch November 29, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants