System.NullReferenceException at Microsoft.Maui.Platform.KeyboardAutoManagerScroll.AdjustPosition()

Frank Schmitt 5 Reputation points
2024-03-04T19:44:02.27+00:00

I'm working on a Maui plugin that sometimes presents some native iOS UI. 

I'm seeing a crash at Microsoft.Maui.Platform.KeyboardAutoManagerScroll.AdjustPosition() when that UI is presented modally and a DidUITextBeginEditing notification is fired (by the native UI). 

Is there something I can do to tell the Maui layer to pause managing UI/keyboard/scroll stuff?

Is there source code I can look at to get a better idea of what's going on?

Developer technologies .NET .NET MAUI
{count} vote

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 36,436 Reputation points Microsoft External Staff
    2024-03-13T05:29:59.61+00:00

    Hello,

    I make a sample and reproduce your issue. And I noticed that you raised an issue at GitHub - Null Pointer Crash in KeyboardAutoScrollManager.AdjustPosition · Issue #21160 · dotnet/maui · GitHub, please follow the progress.

    Also, you could try the solution:

    #if IOS
                KeyboardAutoManagerScroll.Disconnect();
    #endif
    

    Best Regards,

    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.