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

Enable keyboard selection of movable points #991

Closed
wants to merge 1 commit into from

Conversation

benchristel
Copy link
Member

Summary:

This is a step toward making interactive graphs keyboard- and
screen-reader-accessible.

Issue: https://khanacademy.atlassian.net/browse/LC-1666

Test plan:

yarn dev
open http://localhost:5173

Press tab repeatedly. The movable points on the graphs should be
selected in turn, with a visible outline on the selected point.

This is a step toward making interactive graphs keyboard- and
screen-reader-accessible.

Issue: https://khanacademy.atlassian.net/browse/LC-1666

Test plan:

```
yarn dev
open http://localhost:5173
```

Press `tab` repeatedly. The movable points on the graphs should be
selected in turn, with a visible outline on the selected point.
@khan-actions-bot
Copy link
Contributor

Gerald

Required Reviewers
  • @Khan/perseus for changes to packages/perseus/src/interactive2/movable-point-options.ts, packages/perseus/src/util/interactive.ts

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

@benchristel
Copy link
Member Author

@nedredmond this is a spike—I still need to figure out why exactly this works, if there's a better way to do it, how to test it, etc. But it's a first step toward a solution.

Copy link
Contributor

Size Change: +61 B (0%)

Total Size: 814 kB

Filename Size Change
packages/perseus/dist/es/index.js 390 kB +61 B (0%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 38.1 kB
packages/kmath/dist/es/index.js 4.27 kB
packages/math-input/dist/es/index.js 79.7 kB
packages/perseus-core/dist/es/index.js 908 B
packages/perseus-editor/dist/es/index.js 262 kB
packages/perseus-error/dist/es/index.js 878 B
packages/perseus-linter/dist/es/index.js 21.8 kB
packages/pure-markdown/dist/es/index.js 3.77 kB
packages/simple-markdown/dist/es/index.js 12.4 kB

compressed-size-action

@@ -60,6 +60,7 @@ const draw = {
radii,
options,
);
this.state.visibleShape.wrapper.setAttribute("tabindex", "0")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should be using WB Clickable here for better control over states.

@@ -969,6 +969,7 @@ _.extend(GraphUtils.Graphie.prototype, {
radii,
options,
);
movablePoint.mouseTarget.wrapper.setAttribute("tabindex", "0")
Copy link
Contributor

Choose a reason for hiding this comment

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

We have some designs, don't we? Even if we get the browser focus defaults, this won't give us consistency across browsers. Let's look at our designs and at least give that a shot

@benchristel
Copy link
Member Author

Closing this, since we're moving ahead with a Mafs-based solution.

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