From 624a92b0b4c14d2cb1d139c1acdc4bad660c39e0 Mon Sep 17 00:00:00 2001 From: Insanittyx Date: Wed, 12 Jun 2024 21:10:02 +0200 Subject: [PATCH] Remove '?' from javascript to prevent error Adding a '?' works for web, but running Blazored.Modal on a .NET MAUI Blazor Hybrid app causes the javascript to fail. --- src/Blazored.Modal/BlazoredModal.razor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Blazored.Modal/BlazoredModal.razor.js b/src/Blazored.Modal/BlazoredModal.razor.js index 106d3d8..a7a4241 100644 --- a/src/Blazored.Modal/BlazoredModal.razor.js +++ b/src/Blazored.Modal/BlazoredModal.razor.js @@ -11,7 +11,7 @@ const getScrollBarWidth = () => { } const isScrollbarPresent = () => { const beforeScrollbarHidden = document.body.clientWidth; - const overflowState = document.body?.style.overflow; + const overflowState = document.body.style.overflow; document.body.style.overflow = 'hidden'; const afterScrollbarHidden = document.body.clientWidth; document.body.style.overflow = overflowState; @@ -29,4 +29,4 @@ export function setBodyStyle() { export function removeBodyStyle() { el.style.overflow = originalProps.overflow || 'auto'; el.style.paddingRight = originalProps.paddingRight; -} \ No newline at end of file +}