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

[iOS] Keyboard hides Entry on Grid #20231

Closed
DonkeyKongJr opened this issue Jan 29, 2024 · 9 comments
Closed

[iOS] Keyboard hides Entry on Grid #20231

DonkeyKongJr opened this issue Jan 29, 2024 · 9 comments
Labels
area-controls-entry Entry area-keyboard Keyboard, soft keyboard area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter layout-grid platform/iOS 🍎 s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed t/bug Something isn't working

Comments

@DonkeyKongJr
Copy link

Description

When using an Entry field on the bottom of a grid on iOS, the Keyboard overlays the Entry field. On Android everything seems to be working fine.

Android:
Screenshot_1706542669
iOS:
iOS Maui without Keyboard
iOS Maui with Keyboard

Steps to Reproduce

  1. Create a new MAUI Project.
  2. Add a Grid Layout.
  3. Add a Entry Element on the bottom.
  4. Select iOS as target.
  5. Run the app.
  6. Click on the bottom entry field.

See demo project below:

MauiApp1.zip

Link to public reproduction project repository

https://github.com/DonkeyKongJr/MauiKeyboardIssue.git

Version with bug

8.0.6

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.x

Did you find any workaround?

No.

Relevant log output

No response

@DonkeyKongJr DonkeyKongJr added the t/bug Something isn't working label Jan 29, 2024
@jsuarezruiz jsuarezruiz added layout-grid area-keyboard Keyboard, soft keyboard area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter labels Jan 30, 2024
@DonkeyKongJr
Copy link
Author

We do get in our customer application a slightly different behavior. The iOS keyboards pops up, but covers the input halfway through. In this particular place, we use an Editor. The BorderlessEditor inherits directly from Editor.

<controls:BorderlessEditor
    HorizontalOptions="Fill"
    VerticalOptions="Center"
    Keyboard="Chat"
    AutoSize="TextChanges"
    BackgroundColor="Transparent"
    TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}"
    Text="{Binding NewMessageText}"
    MaxLength="400">
    <controls:BorderlessEditor.Behaviors>
        <fixes:TapToCloseBehavior />
    </controls:BorderlessEditor.Behaviors>
</controls:BorderlessEditor>

2024-01-30 09_25_33-iPhone 15 Pro Max iOS 17 2

@PureWeen
Copy link
Member

Can you test with the latest nightly build?
https://github.com/dotnet/maui/wiki/Nightly-Builds

@PureWeen PureWeen added the s/needs-info Issue needs more info from the author label Jan 30, 2024
@ghost
Copy link

ghost commented Jan 30, 2024

Hi @DonkeyKongJr. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@DonkeyKongJr
Copy link
Author

I just tried it out on .NET MAUI 8.0.7-preview.9929 and the issue seems to be resolved.

2024-01-31 10_05_13-iPhone 15 Pro Max iOS 17 2

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Jan 31, 2024
@borrmann
Copy link
Contributor

@PureWeen I have tested it with the nightly build too. It seems fixed when predictive text is turned on in device settings, but not when they are turned off and e.g. an AutoFill mode is used on the Entry or the Keyboard Height changes (e.g. by switching to Emoji keyboard).
See attached video
In the beginning it works as expected.
Then predictive text is turned off in device settings.

  1. After that, the keyboard is above the entry, when a suggestion pops up with a delay.
  2. The keyboard is always above the entry, if the emoji keyboard is opened.
KeyboardBug.mp4

@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Jan 31, 2024
@samhouts samhouts added platform/iOS 🍎 Area: Platform\Xamarin VS\iOS and removed legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor Area: Platform\Xamarin VS\iOS labels Jan 31, 2024
@DonkeyKongJr
Copy link
Author

DonkeyKongJr commented Feb 1, 2024

It seems fixed when predictive text is turned on in device settings, but not when they are turned off and e.g. an AutoFill mode is used on the Entry or the Keyboard Height changes (e.g. by switching to Emoji keyboard).

I can confirm that toggling the predictive text feature negatively affects the keyboard and the positioning of the input element.

RPReplay_Final1706775455.MP4

@borrmann
Copy link
Contributor

borrmann commented Feb 1, 2024

I found this Stackoverflow post. This seems like the default behaviour in swift is actually that the keyboard is included in the Safe Area. Is there a way to turn this default behaviour on?

stackoverflow

Edit:
It appears since iOS 17 there is a property UsesBottomSafeArea in UIKeyboardLayoutGuide .
This seems like the right property, how can this be accessed or changed in MAUI?

@QianaJiao
Copy link

This is the results of 8.0.6
image
It does not repro on 8.0.14.
image

(As mentioned in the above comment, after switching apps, the keyboard will still overlap the content)

@QianaJiao QianaJiao added s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version labels Mar 28, 2024
@DonkeyKongJr
Copy link
Author

DonkeyKongJr commented Apr 10, 2024

I have tested it with the latest version (8.0.14 and then 8.0.20), but the issue unfortunately remains.

RPReplay_Final1712739512.MP4

@dotnet-policy-service dotnet-policy-service bot removed the s/try-latest-version Please try to reproduce the potential issue on the latest public version label Apr 10, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-entry Entry area-keyboard Keyboard, soft keyboard area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter layout-grid platform/iOS 🍎 s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants