-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Test for EditorAccessibility #2456
Test for EditorAccessibility #2456
Conversation
This component is definitely not the best so feel free to rework it! The text of this p5.js-web-editor/client/modules/IDE/components/Editor/index.jsx Lines 198 to 201 in d5eee45
(Introduced in this commit db85dcc) The
|
Oh ouch. OK, I think storing the line number to local state and passing it down as a prop would work. But this would trigger the whole component to re-render on each Side note. I'm not sure why we're only recomputing line number on the |
I'm still intending on looking into this. Work deliverables have been taking priority. I think extracting the Code Mirror instance out to a React Context would work to expose access to all child components. Generally I'd prefer to avoid context if possible as they add a little magic to the code as to where an instance was initialised. |
I think it would only cause a re-render if the
It's probably safe to assume that whoever wrote it didn't know about the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've had a lot of discussion here about future improvements but I'm going to go ahead and merge in the these tests for now. Thanks!
Changes:
After creating a story for this component it became apparent that the visual story was redundant. A better way to document this components behaviour is through unit tests.
#2398
oneOf
to limit down the severity options. This matches the severity options in CodeMirror where these messages are generated from. https://codemirror.net/docs/ref/#lint.Diagnostic.severityI think this component is malformed. It looks like some work has gone into enhancing aria properties for the line number. But it contains an empty string. Perhaps it was intended to be a sub component?
It appears redundant to me. I'd be in favour of removing it for now until its known what it is used for.
An interesting post on inclusively hiding content. I was wondering if its worth updating
%hidden-element
to use clip, rather than positioning 10000px off screen. They both seem to remain available to assistive technology (I haven't verifyied). But clipping isn't relying on a large offset to hide.https://www.scottohara.me/blog/2017/04/14/inclusively-hidden.html
I have verified that this pull request:
npm run lint
)npm run test
)develop
branch.Fixes #123