fix(core): matchBreakpoint will return true if breakPoint is empty string (#15498)

Closes #15495
This commit is contained in:
Paul Stelzer
2018-09-07 16:16:37 +02:00
committed by Manu MA
parent b28aeab50d
commit b362b0ad8d

View File

@@ -11,7 +11,7 @@ export const SIZE_TO_MEDIA: any = {
// at the breakpoint passed
// e.g. matchBreakpoint('sm') => true if screen width exceeds 576px
export function matchBreakpoint(win: Window, breakpoint: string | undefined) {
if (breakpoint === undefined) {
if (breakpoint === undefined || breakpoint === '') {
return true;
}
const mediaQuery = SIZE_TO_MEDIA[breakpoint];