Skip to content

Commit eb75249

Browse files
Only use turbolinks events if supported
The current code always uses Turbolinks events if it is loaded, but this doesn't mean it is supported by the browser. This change checks if turbolinks is supported and otherwise uses the native event handlers. Without this fix ujs components are not rendered in IE8.
1 parent 81d423e commit eb75249

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/assets/javascripts/react_ujs.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,9 @@
6161
}
6262
};
6363

64-
typeof Turbolinks !== 'undefined' ? handleTurbolinksEvents() : handleNativeEvents();
64+
if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {
65+
handleTurbolinksEvents();
66+
} else {
67+
handleNativeEvents();
68+
}
6569
})(document, window, React);

0 commit comments

Comments
 (0)