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

The WindowSoftInputMode property on the Activity attribute is ignored #14281

Open
arielmoraes opened this issue Mar 30, 2023 · 5 comments
Open
Labels
area-keyboard Keyboard, soft keyboard platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/a11y Relates to accessibility t/bug Something isn't working
Milestone

Comments

@arielmoraes
Copy link

arielmoraes commented Mar 30, 2023

Description

I was playing around with the WindowSoftInputMode modes and where to set them. If you set the mode for the entire App it works as expected, but if you set it for a specific Activity using the attribute the mode is not respected.

Steps to Reproduce

Create a New Maui Project.
Add a few elements to the MainPage to make the ScrollView scrollable
Set the property WindowSoftInputMode to Android.Views.SoftInput.AdjustResize using the Activity attribute on the Android specific folder

Run the app and focus the last Entry, the soft input will pop up and the behavior is adjustPan not adjustResize as desired.

Link to public reproduction project repository

https://github.com/arielmoraes/MauiHelloWorld

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 13

Did you find any workaround?

Not a workaround, but setting it for the entire application works as expected.

Relevant log output

No response

@arielmoraes arielmoraes added the t/bug Something isn't working label Mar 30, 2023
@mattleibow mattleibow added legacy-area-a11y Relates to accessibility area-keyboard Keyboard, soft keyboard labels Mar 30, 2023
@mattleibow mattleibow added this to the Backlog milestone Mar 30, 2023
@ghost
Copy link

ghost commented Mar 30, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@PureWeen
Copy link
Member

@arielmoraes you can modify this behavior using the following platform specific https://learn.microsoft.com/en-us/dotnet/maui/android/platform-specifics/soft-keyboard-input-mode?view=net-maui-7.0 which is most likely overwriting the change via the attribute.

I'm curious if we can detect that attribute and bypass our code.

@arielmoraes
Copy link
Author

@PureWeen I might be wrong here, but I think the windowSoftInputMode option is set per Activity on Android. It's ok to have an application global option, but maybe when using the Activity attribute it should have precedence over the application.

Just to be clear, I haven't set the behavior on the application.

@PureWeen
Copy link
Member

PureWeen commented Mar 31, 2023

@PureWeen I might be wrong here, but I think the windowSoftInputMode option is set per Activity on Android. It's ok to have an application global option, but maybe when using the Activity attribute it should have precedence over the application.

Just to be clear, I haven't set the behavior on the application.

Yea, we should update the docs. That property also works if you specify it on the Window directly. So, if you open different Windows you could apply that property to each window.

dotnet/docs-maui#1388

@Zhanglirong-Winnie Zhanglirong-Winnie added s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage labels Jun 15, 2023
@Zhanglirong-Winnie
Copy link
Collaborator

Verified this issue with Visual Studio Enterprise 17.7.0 Preview 1.0. Can repro on android platform with sample project.
MauiHelloWorld-main.zip

@Eilon Eilon added t/a11y Relates to accessibility and removed legacy-area-a11y Relates to accessibility labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-keyboard Keyboard, soft keyboard platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/a11y Relates to accessibility t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants