Last active
November 9, 2017 11:27
-
-
Save yuschick/1591ff74bc0124b064d5d28a5ee3bee9 to your computer and use it in GitHub Desktop.
Accessible Web Apps with React, TypeScript & Ally.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Handle { | |
disengage(): void; | |
} | |
class Dialog extends React.Component<Props> { | |
dialog: HTMLElement | null; | |
disabledHandle: Handle; | |
focusHandle: Handle; | |
componentDidMount() { | |
this.disabledHandle = Disabled({ | |
filter: this.dialog, | |
}); | |
this.focusHandle = TabFocus({ | |
context: this.dialog, | |
}); | |
let element = FirstTab({ | |
context: this.dialog, | |
defaultToContext: true, | |
}); | |
element.focus(); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment