-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IOS] KeyboardAutoScrollManager NullReferenceException when focussing Editor/Entry in modal bottom sheet #21726
Comments
Coud be because of this change. In our app we are also facing this even after BottomSheet was closed or never opened. Looks like SearchHandler is facing a similar Issue. After Navigating away from a Page that had focus in SearchHandler we get this callstack
|
Can repro this issue at iOS platform on the MauiVersion(8.0.7 & 8.0.14). |
Adding a null check to the I pulled the bottom sheets library into the maui controls sample and have been able to get it working. I'll raise a pr! |
Description
When using [The49.Maui.BottomSheet](https://github.com/the49ltd/The49.Maui.BottomSheet) to display a
BottomSheet
, I have discovered a crash on iOS that is happening within theKeyboardAutoScrollManager.AdjustPosition
method.I understand this is caused by working with an external library, however a
NullReferenceException
being thrown internally by Maui clearly indicates an issue that could affect peoples apps in the wild.Steps to Reproduce
This issue only occurs when the page calling the
BottomSheet
is itself a modal page. If there is only 1 page on the navigation stack the controls work correctly & no crash.Editor
/Entry
Expected:
The control is focussed, keyboard displayed and you can enter text
Actual:
The following crash happens:
Link to public reproduction project repository
https://github.com/Axemasta/KeyboardAutoScrollRepro
Version with bug
8.0.14 SR3.1
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 17.2
Did you find any workaround?
This works when the presenting page is not modal:
![non-modal-working-bottomsheet](https://private-user-images.githubusercontent.com/33064621/320875559-77fa0724-a968-4a6b-b388-40237331f68c.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg5MTY0MTQsIm5iZiI6MTcxODkxNjExNCwicGF0aCI6Ii8zMzA2NDYyMS8zMjA4NzU1NTktNzdmYTA3MjQtYTk2OC00YTZiLWIzODgtNDAyMzczMzFmNjhjLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIwVDIwNDE1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYzNGFlN2UxMDFkODg4OGJiZGU2NDUwZTVjNTllODkzODEzNmNmYWZiYzgwNTYwYTVlMjZiMTE4ODEyN2UxM2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ZnMGnAolw2SWAEU_NPLZyHrtVBzUCmjgk0brYQEmvCQ)
In this example I have set the
Application.MainPage
to the page responsible for showing the dialogs. As you can see the dialogs appear and the textfields can be interacted with.Relevant log output
No response
The text was updated successfully, but these errors were encountered: