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

NumberControl: support for accessibleName and helpText, display units in A11y View #878

Open
pixelzoom opened this issue Oct 20, 2024 · 0 comments

Comments

@pixelzoom
Copy link
Contributor

Related to phetsims/models-of-the-hydrogen-atom#67 and phetsims/sun#901 ...

NumberControl does not support accessibleName and helpText. You can provide these options, but they are ignored.

Developers have been using this undesirable workaround in sim-specific code:

const numberControl = new NumberControl( ..., {
  ...
  sliderOptions: {
    ...
    accessibleName: 'The accessible name.',
    helpText: 'The help text.'
  },
} );

Besides the obvious problems of reaching inside NumberControl to access its Slider, this workaround does not address the units associated with the NumberControl's value. NumberControl is responsible for units, Slider has no knowledge of units. So for example in MOTHA, we end up with this in the A11y View, where we want to see "380 nm".

screenshot_3525
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants