Skip to content

Instantly share code, notes, and snippets.

@ptrin
ptrin / consulting-opportunity.md
Created July 14, 2019 03:06
Fable Consulting Opportunity

Consulting opportunity:

At Fable, we’ve built an online platform that connects researchers, designers, and developers to people with disabilities, with the goal of making it easier to create accessible digital products.

We have upcoming projects that involve conducting accessibility research remotely, through moderated and unmoderated research, on various digital products. We are looking for someone who can manage a project, conduct the research, and lead the writing of reports. We don’t have exact dates of the projects yet, but anticipate some starting in August and completing before November. Further clarification on dates is expected soon.

What you’ll do:

  • Learn about the client’s digital products and production workflow to identify and establish user journeys for testing, a configuration matrix, and reporting structure
  • Use Fable’s platform to
@ptrin
ptrin / 0-add-id-to-error-div.jsx
Last active November 13, 2019 17:38
Formik a11y examples
<ErrorMessage name="firstName">
{msg => (
<div id="firstName-error" className="invalid-feedback">
{msg}
</div>
)}
</ErrorMessage>
@ptrin
ptrin / example.js
Created May 13, 2020 13:15
Adjust scroll position on focus (if necessary)
const oldHTMLFocus = HTMLElement.prototype.focus;
HTMLElement.prototype.focus = function () {
oldHTMLFocus.apply(this, arguments);
setTimeout(function() {
const currentScrollPos = window.scrollY || window.scrollTop;
const offset = $(this).offset().top;
// if difference between currentScrollPos and offset from top of document is less than x, adjust
const difference = Math.abs(currentScrollPos - offset);
if (difference < 100) {
window.scrollTo(0, currentScrollPos - 100);