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

[BUG] Android, keyboard make cupertino infinity sky) #188

Closed
bazuka5801 opened this issue Jul 28, 2022 · 9 comments
Closed

[BUG] Android, keyboard make cupertino infinity sky) #188

bazuka5801 opened this issue Jul 28, 2022 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@bazuka5801
Copy link

bazuka5801 commented Jul 28, 2022

Describe the bug
When I open the keyboard, my Cupertino goes up.
And this problem (no background at the bottom) appears on iOS when we turn on the bounce animation to breaks.
I've tried adding :after to .cupertino-pane to solve this problem, but i think, it's bicycle stick :)

To Reproduce
Steps to reproduce the behavior:

  1. Add input to cupertino
  2. Click on input

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Desktop (please complete the following information):

  • OS: Android
  • Capacitor App
  • Version API 29
@roman-rr
Copy link
Collaborator

@bazuka5801 thank you, seems to related to #187 also. Will check.

@roman-rr roman-rr self-assigned this Jul 29, 2022
@roman-rr roman-rr added the bug Something isn't working label Jul 29, 2022
@roman-rr
Copy link
Collaborator

roman-rr commented Feb 2, 2023

@bazuka5801 Please check v1.3.2 with recent fix and let me know if it's works better.

@bazuka5801
Copy link
Author

@roman-rr As of today, I have dropped support for android in my project, and now it is too difficult to check this issue for android. I am sure we can close this issue, if something goes wrong in the future, I will let you know.

@danilabais
Copy link

danilabais commented Aug 1, 2023

Hi,

the bug remained, on Android and iOS (Capasitor). infinity sky only appears when the input is too low to the bottom of the pane. if it is 10 pixels higher, then infinity sky is smaller, if it is even higher, then there is no infinity sky at all. Apparently the indent is somehow incorrectly calculated if the input is low. if you need to write code with this problem - let me know.

I will be glad if you offer a quick solution to this problem

@roman-rr
Copy link
Collaborator

roman-rr commented Aug 1, 2023

@danilabais
Please records short video for better view in perspective.

@roman-rr roman-rr reopened this Aug 1, 2023
@danilabais
Copy link

Behavior similar to ios and android: the lower the input is located to the bottom of the screen, the larger the infinity sky will be

android video: click
ios video: click

settings of capasitor keyboard plugin:

"plugins": {
    "Keyboard": {
      "resize": "body",
      "style": "DARK",
      "resizeOnFullScreen": true
    }
  }
  

pane:
handleKeyboard: true, // TODO: bug

@danilabais
Copy link

danilabais commented Aug 12, 2023

Everywhere this bug was closed with crutches.

Here is a quick code for anyone who needs it. Looks to work as it should.

ps:
this code will work if the input is at the bottom only because of the scroll.
if it is at the bottom and the scroll is also at the bottom, then layout will help here. You need to make sure that the cupertino-pane content is no more than 100vh, and everything that should scroll is already in this block with overflow-y: auto

const fixAndroid = async () => {
    if ((await Device.getInfo()).platform !== 'android') return

    document.addEventListener('click', ({ target }) => {
        const contentEditable = ['TEXTAREA', 'INPUT']
        const offset = 130
        if (!contentEditable.includes(target.tagName)) return
        if (window.innerHeight - target.getBoundingClientRect().bottom < offset) {
            target.scrollIntoView({ block: "center" })
        }
    })
}
fixAndroid()

@roman-rr
Copy link
Collaborator

Everywhere this bug was closed with crutches.

Here is a quick code for anyone who needs it. Looks to work as it should.

ps: this code will work if the input is at the bottom only because of the scroll. if it is at the bottom and the scroll is also at the bottom, then layout will help here. You need to make sure that the cupertino-pane content is no more than 100vh, and everything that should scroll is already in this block with overflow-y: auto

import { Device } from '@capacitor/device';

const fixAndroid = async () => {

    if ((await Device.getInfo()).platform !== 'android') return

    document.addEventListener('click', ({ target }) => {
        const contentEditable = ['TEXTAREA', 'INPUT']
        const offset = 100
        if (!contentEditable.includes(target.tagName)) return
        if (window.innerHeight - target.getBoundingClientRect().bottom < offset) {
            target.scrollIntoView()
        }
    })
}
fixAndroid()

Thank you for solution, I will use it for fix.

@roman-rr
Copy link
Collaborator

Should be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants