When using the new MediaQuery, I am receiving an error on the iPad (Safari) but works fine with desktop and Android. Safari does not have support for addEventListener.
warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
Unhandled exception rendering component: this.mediaQueryList.addEventListener is not a function. (In 'th
is.mediaQueryList.addEventListener("change",this.onMediaChange)', 'this.mediaQueryList.addEventListener' is un
defined)
value@https://localhost:5001/_content/Telerik.UI.for.Blazor/js/telerik-blazor.js:59:14905
e@https://localhost:5001/_content/Telerik.UI.for.Blazor/js/telerik-blazor.js:59:14611
r@https://localhost:5001/_content/Telerik.UI.for.Blazor/js/telerik-blazor.js:1:13840
r@https://localhost:5001/_content/Telerik.UI.for.Blazor/js/telerik-blazor.js:59:12983
-------------------------------------------------------
I've implemented a rather ugly workaround for now but this should be resolved within Telerik itself.
Add this above <script src="_content/Telerik.UI.for.Blazor/js/telerik-blazor.js" defer></script>:
<script>
var mediaObj = window.matchMedia("");
if (typeof mediaObj.addEventListener != "function") {
mediaObj.__proto__.addEventListener = function(event, listener) {
mediaObj.addListener(listener);
}
}
</script>