[fix] don't run 'modality' without a DOM

Fix #387
This commit is contained in:
Nicolas Gallagher
2017-03-09 18:13:00 -08:00
parent e929fb572d
commit 3ae1e5b786
+6
View File
@@ -1,5 +1,7 @@
/* global document, window */
import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';
/**
* Adapts focus styles based on the user's active input modality (i.e., how
* they are interacting with the UI right now).
@@ -16,6 +18,10 @@
* Based on https://github.com/WICG/modality
*/
const modality = () => {
if (!canUseDOM) {
return;
}
/**
* Determine whether the keyboard is required when an element is focused
*/