panes icon indicating copy to clipboard operation
panes copied to clipboard

[BUG] Android, keyboard make cupertino infinity sky)

Open bazuka5801 opened this issue 2 years ago • 1 comments

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

bazuka5801 avatar Jul 28 '22 20:07 bazuka5801

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

roman-rr avatar Jul 29 '22 08:07 roman-rr

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

roman-rr avatar Feb 02 '23 13:02 roman-rr

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

bazuka5801 avatar Feb 03 '23 12:02 bazuka5801

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

danilabais avatar Aug 01 '23 09:08 danilabais

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

roman-rr avatar Aug 01 '23 17:08 roman-rr

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 avatar Aug 01 '23 18:08 danilabais

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()

danilabais avatar Aug 12 '23 23:08 danilabais

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 avatar Aug 13 '23 08:08 roman-rr

Should be fixed

roman-rr avatar Aug 15 '23 05:08 roman-rr