PWA Fundvelo der Caritas.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ScrollLockRemover.cs 808B

1234567891011121314151617181920212223
  1. using Microsoft.JSInterop;
  2. using System.Threading.Tasks;
  3. namespace cwebplusApp.Shared.Services {
  4. // This class is only needed to work around a bug in MatDialogService.AskAsync.
  5. // It removes a class from body, which is erroneously left there after a call to AskAsync.
  6. // See https://github.com/SamProf/MatBlazor/issues/829 . REMOVE AS SOON AS THE BUG IS FIXED!
  7. public class ScrollLockRemover {
  8. private readonly IJSRuntime jsRuntime;
  9. public ScrollLockRemover(IJSRuntime _jsRuntime) {
  10. this.jsRuntime = _jsRuntime;
  11. }
  12. public async Task removeScrollLockAsync() {
  13. var reference = DotNetObjectReference.Create(this);
  14. await jsRuntime.InvokeVoidAsync("RemoveScrollLock", reference);
  15. }
  16. }
  17. }