Skip to content

Commit d1d2af5

Browse files
committed
Fix escape-key logic for ComponentPlayground
1 parent 51f1179 commit d1d2af5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/component-playground.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import FullscreenButton from './fullscreen-button';
77

88
import {
99
requestFullscreen,
10-
exitFullscreen
10+
exitFullscreen,
11+
getFullscreenElement
1112
} from '../utils/fullscreen';
1213

1314
import {
@@ -124,7 +125,7 @@ class ComponentPlayground extends Component {
124125
evt.stopPropagation();
125126

126127
// Esc: When entering the editor or an input element the default esc-to-exit might not work anymore
127-
if (evt.keyCode === 27 && document.fullscreenElement) {
128+
if (evt.keyCode === 27 && getFullscreenElement()) {
128129
exitFullscreen();
129130
}
130131
}

0 commit comments

Comments
 (0)