Skip to content

Instantly share code, notes, and snippets.

View jessebeach's full-sized avatar
🦆
mostly there

J. Renée Beach jessebeach

🦆
mostly there
  • Facebook / Meta
  • Redwood City, CA
  • 11:47 (UTC -07:00)
  • X @jessebeach
View GitHub Profile
6.2.0 / 2019-01-25
=================
- 5650674 [new rule] control-has-associated-label checks interactives for a label
- f234698 [docs] add How to manage IDs
- 9924d03 [docs] document jsx-a11y/label-has-associated-control assert option
- 77b9870 [docs] Add newlines below headings
- 8244e43 [docs] Add syntax highlighting to example
- 26f41c8 [docs] Change explanation for role="presentation" escape hatch
- 33a1f94 [fix] - Purely decorative emojis do not need descriptions.
- 29d20f7 [fix] (package): update emoji-regex to version 7.0.2
@jessebeach
jessebeach / gist:3cf49ecac439ac6b5fd42935b5c43278
Created January 5, 2019 00:05
Non-Abstract ARIA Roles with Properties (and default values if applicable)
[
[
"alert",
{
"abstract":false,
"accessibleNameRequired":false,
"baseConcepts":[
],
"childrenPresentational":false,
class Grid extends React.Component {
_timeoutID;
constructor() {
this.state = {
isManagingFocus: false,
};
}
// see https://github.com/facebook/flow/issues/1414
const trackChildren: Array<any> = node.children.filter((child) => {
if (child.type !== 'JSXElement') {
return false;
}
return elementType(child.openingElement) === 'track';
});
// $FlowFixMe https://github.com/facebook/flow/issues/1414
const trackChildren: Array<JSXElement> = node.children.filter((
child: Node,
) => {
if (child.type !== 'JSXElement') {
return false;
}
return elementType(child.openingElement) === 'track';
});
isNonInteractiveElement
JSX Components (no tagName)
✓ should identify them as interactive elements (3ms)
non-interactive elements
✓ should identify `a` as a non-interactive element (1ms)
✓ should identify `area` as a non-interactive element (1ms)
✓ should identify `article` as a non-interactive element
✓ should identify `dd` as a non-interactive element (1ms)
✓ should identify `dfn` as a non-interactive element
✓ should identify `dt` as a non-interactive element
@jessebeach
jessebeach / gist:c0e24b409418f2ffdec6d60c36553f6e
Created February 2, 2017 20:09
Interactive, non-interactive and indeterminate elements regarding ARIA roles
non-interactive elements
✓ should identify `a` as a non-interactive element (1ms)
✓ should identify `area` as a non-interactive element
✓ should identify `article` as a non-interactive element (1ms)
✓ should identify `dd` as a non-interactive element
✓ should identify `dfn` as a non-interactive element
✓ should identify `dt` as a non-interactive element
✓ should identify `fieldset` as a non-interactive element
✓ should identify `figure` as a non-interactive element
✓ should identify `frame` as a non-interactive element
JSX Components (no tagName)
✓ should identify them as interactive elements (2ms)
non-interactive elements
✓ should identify `a` as a non-interactive element (1ms)
✓ should identify `area` as a non-interactive element
✓ should identify `article` as a non-interactive element
✓ should identify `dd` as a non-interactive element
✓ should identify `dfn` as a non-interactive element
✓ should identify `dt` as a non-interactive element
✓ should identify `fieldset` as a non-interactive element
var colors = require('colors/safe');
function isort (arr) {
for (var j = 1, il = arr.length; j < il; j++) {
var key = arr[j];
var i = j - 1;
while (i > -1 && arr[i] > key) {
var left = arr.slice(i, i + 1);
var right = arr.slice(i + 1, i + 2);
var start = arr.slice(0, i);
@jessebeach
jessebeach / typeTagOf.js
Created January 27, 2016 19:38
typeTagOf
const typeTagOf = (value) => Object.prototype.toString.call(value).slice(8, -1);
console.log(typeTagOf({})); // 'Object'
console.log(typeTagOf([])); // 'Array'
console.log(typeTagOf(function () {})); // 'Function'