Closed enjikaka closed 3 years ago
.isFullscreen
literally cannot return undefined
: https://github.com/sindresorhus/screenfull.js/blob/eddb5fc63d74b714edabe7829f5b0e007eb1689c/src/screenfull.js#L154-L158 There's something else going on.
Hello,
I have the same problem. the isFullscreen property does not exist.
import * as screenfull from 'screenfull';
export class AppComponent implements OnInit {
isFullScreen: boolean | undefined;
ngOnInit() : void {
if (screenfull.isEnabled) {
screenfull.on('change', () => {
this.isFullScreen = screenfull.isFullscreen;
})
}
}
}
Error: src/app/app.component.ts:16:40 - error TS2339: Property 'isFullscreen' does not exist on type 'Screenfull | { isEnabled: false; }'.
Property 'isFullscreen' does not exist on type '{ isEnabled: false; }'.
16 this.isFullScreen = screenfull.isFullscreen;
@eliasbg
open screenfull.d.ts
file
find screenfull declare (about 169 lines):
declare let screenfull: screenfull.Screenfull | {isEnabled: false};
fix:
declare let screenfull: screenfull.Screenfull;
you can access isFullscreen
property
After going into fullscreen, in the callback onchange, getting isFullscreen returs
undefined
in v 5.1.0