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

fix: improve native web tap (strict) and support iOS 15 #1352

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zcmgyu
Copy link
Contributor

@zcmgyu zcmgyu commented Nov 9, 2021

Please ignore reviewing until I update the description and unit test.

iOS < 15.x or iOS ≥ 15.x but Tab Bar is Top:

iPhone PORTRAIT:

NORMAL, with NOTCH:

  • x = 0
  • y = availHeight - innerHeight - 3 (OFFSET WITH ACTUAL) - 49 (FIXED BOTTOM) - 30 (FIXED INDICATOR)

NORMAL, without NOTCH:

  • x = 0
  • y = availHeight - innerHeight + 1 (OFFSET WITH ACTUAL) - 44 (FIXED BOTTOM)

COLLAPSED, all devices:

  • x = 0
  • y = availHeight - innerHeight + 1 (OFFSET WITH ACTUAL)

iOS < 15.x:

iPhone LANDSCAPE:

NORMAL, with NOTCH:

  • x = (availWidth - innerWidth) / 2
  • y = availHeight - innerHeight + 1 (OFFSET WITH ACTUAL)

NORMAL, without NOTCH:

  • x = 0
  • y = availHeight - innerHeight + 1 (OFFSET WITH ACTUAL)

COLLAPSED, with NOTCH:

  • x = (availWidth - innerWidth) / 2
  • y = 0

COLLAPSED, without NOTCH:

  • x = 0
  • y = 0

iPad PORTRAIT & LANDSCAPE, NORMAL & COLLAPSED:

  • x = 0
  • y = availHeight - innerHeight + 1 (OFFSET WITH ACTUAL)

iOS ≥ 15.x

iPhone PORTRAIT, NORMAL & COLLAPSED

with NOTCH:

  • x = 0
  • y = 47 (FIXED TOP)

without NOTCH:

  • x = 0
  • y = 20 (FIXED TOP (status bar))

iPhone LANDSCAPE

NORMAL, with NOTCH:

  • x = (availWidth - innerWidth) / 2
  • y = 48 (FIXED TOP)

COLLAPSED, with NOTCH:

  • x = (availWidth - innerWidth) / 2
  • y = 0

NORMAL, without NOTCH:

  • x = 0
  • y = 60 (FIXED TOP)

COLLAPSED, without NOTCH:

  • x = 0
  • y = 0

iPad PORTRAIT & LANDSCAPE, NORMAL & COLLAPSED:

  • x = 0
  • y = availHeight - innerHeight

How to recognize the top bar collapsed or not?

  • iPhone: availHeight - innerHeight less than 100 is collapsed.
  • iPad: availHeight - innerHeight less than 50 is collapsed.

@baselalali
Copy link

We had problem with click on iOs 15. hopefully this PR will fix the problem .

@zcmgyu
Copy link
Contributor Author

zcmgyu commented Jan 5, 2022

Hi @baselalali, I've just received a report about could not click on iPad landscape mode only from testers. So you could clone this PR and use it in your project. I feel free if you can give me feedback. Thanks.

@KazuCocoa
Copy link
Member

FYI: I've merged #1361 to configure safari's tab bar position. It probably affects this PR.

@zcmgyu zcmgyu changed the title fix: Improve native web tap (strict) and support iOS 15 fix: improve native web tap (strict) and support iOS 15 Feb 7, 2022
@mykola-mokhnach
Copy link
Contributor

@zcmgyu What do you think about #2071 ?
Would such approach be more reliable than manual hardcoding of coordinates?
We may even make it more advanced by putting a transparent click overlay over the existing web page, so no url change for calibration would be needed. Would you be interested in such implementation?

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

Successfully merging this pull request may close these issues.

4 participants