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

dropDownをiOSでも表示させるように #4114

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

nokhnaton
Copy link
Contributor

@nokhnaton nokhnaton commented Oct 23, 2023

fix: #2088
iOSでキーボードを開いた時、CSSのtopの基準はキーボードの高さ分上にずれるのに対して、getBoundingClientRectはディスプレイ上部で固定されていたため、表示位置がずれていた。
window.visualViewport.offsetTopを利用することでそこのずれを取得することができた

@github-actions
Copy link

@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!.

@nokhnaton nokhnaton marked this pull request as ready for review October 23, 2023 06:30
Copy link
Member

@ras0q ras0q left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

window.visualViewport.offsetTop初耳だった
Safari、PWAで確認しました
imageimage

Copy link
Member

@mehm8128 mehm8128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

僕のスマホ(Android)で表示されなくなってそうです:thinking:
調査はあとでします

@nokhnaton
Copy link
Contributor Author

僕のスマホ(Android)で表示されなくなってそうです🤔 調査はあとでします

理由としてwindow.visualViewport.offsetTopの値が正か負の:wa_deka:に設定されているくらいしか理由がパッと思いつきませんが、android持ってないので試せないです。
正直、iOSでだけ新しい式になるように書き換えるとかでもいい気はしているので、ちょっと調べてわからなさそうならiOSでだけ書き換えるようにします

@mehm8128
Copy link
Member

mehm8128 commented Nov 9, 2023

今見てみたらwindow.visualViewport.offsetTopは280でした

解決法分からなければ

iOSでだけ新しい式になるように書き換える

でよさそうです

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.

iOSでの補完候補表示がうまく効かない
3 participants