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 |
lindapaiste
left a comment
There was a problem hiding this comment.
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
oneOfto 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-elementto 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)developbranch.Fixes #123