Skip to content
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

[MaterialAlertDialogBuilder] The background inset used by MaterialAlertDialog prevents it from panning up sufficiently when keyboard opens to prevent overlap #4273

Open
Sahara150 opened this issue Aug 29, 2024 · 0 comments

Comments

@Sahara150
Copy link

Sahara150 commented Aug 29, 2024

MRP.zip

Description: When using the MaterialAlertDialogBuilder to create a popup of sufficient size with an edit text, as soon as the edit text gains focus and the softboard appears, the popup does not slide up sufficiently to prevent an overlay but stops a significant amount of space from the top.

Expected behavior:
The popup should slide as far as it needs to to prevent overlap, as does a popup created with normal AlertDialog:
grafik

Source code: The issue is caused by the backgroundInset defined in MaterialAlertDialog.MaterialComponents.
Overriding the alertDialogStyle of the MaterialAlertDialog with a style that overrides those insets with 0 fixes the issue. However, this is still a bug because the top and bottom distance to the edges should be abandoned if space requires to.
The method loading them is

MaterialDialogs.getDialogBackgroundInsets(context, DEF_STYLE_ATTR, DEF_STYLE_RES);

Minimal sample app repro: ZIP appended

Android API version: API 28, API 31, seems to appear independently of API

Material Library version: 1.12.0

Device: Samsung, Pixel 7, does not matter as long as it is small enough

We also happily accept pull requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants