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

[Bug][a11y]: ColorSlider fails to announce new value on change after a keydown event #3303

Closed
1 task done
majornista opened this issue Jun 9, 2023 · 0 comments · Fixed by #3304
Closed
1 task done
Labels
a11y Issues related to accessibility bug Something isn't working Component: Color slider triage An issue needing triage

Comments

@majornista
Copy link
Contributor

majornista commented Jun 9, 2023

Code of conduct

  • I agree to follow this project's code of conduct.

Impacted component(s)

ColorSlider

Expected behavior

Using VoiceOver, ColorSlider should announce the new value after using ArrowRight/ArrowLeft/ArrowUp/ArrowDown.

Actual behavior

Using VoiceOver, ColorSlider fails to announce the new value after using ArrowRight/ArrowLeft/ArrowUp/ArrowDown.

Screenshots

No response

What browsers are you seeing the problem in?

No response

How can we reproduce this issue?

  1. With VoiceOver running on MacOS, go to https://opensource.adobe.com/spectrum-web-components/components/color-slider/#default
  2. Move keyboard focus to the sp-color-slider instance under the heading "Default"
  3. Use ArrowRight or ArrowUp to increment the value several steps.
  4. Notice that VoiceOver fails to announce the new value.

Sample code that illustrates the problem

Possible solution:

  1. Add aria-valuetext to the input at:
                .value=${String(this.value)}
                aria-valuetext=${`${Math.round(this.value)}°`}
  1. Fix the sliderHandlePosition calculation in handleKeydown, so that we increment by the value of a step rather than 360/100, at:
    this.sliderHandlePosition = Math.min(
    100,
    Math.max(0, this.sliderHandlePosition + delta)
    );

    to
        const range = 360;
        const mult = 100 / range;
        this.sliderHandlePosition = Math.min(
            100,
            Math.max(0, this.sliderHandlePosition + delta * mult)
        );

Logs taken while reproducing problem

No response

@majornista majornista added bug Something isn't working triage An issue needing triage a11y Issues related to accessibility Component: Color slider labels Jun 9, 2023
Westbrook pushed a commit that referenced this issue Jul 11, 2023
* fix(color-slider): sp-color-slider fails to announce new value on change after keydown #3303

* fix(color-slider): add expect(el.value) to keyboard tests

* refactor: test handle position more uniformly

---------

Co-authored-by: Westbrook Johnson <wesjohns@adobe.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Issues related to accessibility bug Something isn't working Component: Color slider triage An issue needing triage
Projects
None yet
1 participant