iOS keyboard can collapse an upward popover to max-height 0

オープン
#10,891 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@kokoskiwi がすでに取り組んでいます。

2026年10月29日 から。

  • #10892 @kokoskiwi による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
ios, react, typescript

調査の方向性

Start by locating getContainerDimensions and getMaxHeight in React Aria’s popover positioning code; the issue identifies their inconsistent use of the visual viewport origin as the cause. Trace how the viewport origin and pinch zoom handling feed the height calculation, then add a deterministic hook level regression test using the recorded viewport values. Done when the test verifies a positive available height instead of max-height: 0.

索引モデルが issue の本文から書いたものです。

説明

Provide a general summary of the issue here

An upward React Aria popover can receive max-height: 0 on iOS 26 Safari while the software keyboard is open. The visual viewport's offsetTop can disagree with the coordinate system used by the trigger and boundary rectangles.

🤔 Expected Behavior?

The popover should use the available space above its trigger, including its scrollable list, while the keyboard is visible.

😯 Current Behavior

On an iPhone 17 Simulator running iOS 26.5, the popover opened above a composer but only its search field was visible. React Aria calculated max-height: 0 for the content. In the observed state:

Value Measurement
document.documentElement.scrollTop 466
visualViewport.pageTop 466
visualViewport.offsetTop 310
visualViewport.height 404
trigger getBoundingClientRect().top 214

getContainerDimensions uses pageTop - scrollTop (0) as the viewport top, but getMaxHeight uses offsetTop (310). For a top popover, that makes the available height clamp to zero. The same calculation without the inconsistent offsetTop yields about 198 px in the reduced test case.

💁 Possible Solution

Use the visual viewport origin already calculated by getContainerDimensions when bounding popover height, including its existing pinch zoom handling.

🔦 Context

This affects an upward Collections picker with an internal search field above a bottom composer. The picker cannot display or scroll its choices while the keyboard is open. A deterministic regression test for the observed viewport values will be included in the proposed fix.

🖥️ Steps to Reproduce
  1. On iOS 26 Safari, place a React Aria popover above an input near the bottom of a scrolled page, with a search field inside the popover.
  2. Open the software keyboard, then open the popover with placement="top".
  3. Inspect the popover's computed max-height and the visualViewport values above. The issue occurs when WebKit reports a positive offsetTop although the rects remain in the layout viewport's coordinates.

The hook-level regression test in the proposed PR fixes the recorded geometry at these values, verifies the current code returns max-height: 0, and checks the expected positive height after the change.

Version

react-aria 3.53.1

What browsers are you seeing the problem on?

Safari

If other, please specify.

N/A

What operating system are you using?

iOS 26.5 (iPhone 17 Simulator)

🧢 Your Company/Team

Independent application using React Aria

🕷 Tracking Issue

None

主要言語
TypeScript
スター
16k
フォーク
1.6k
平均マージ
4日 3時間
マージ済み PR(30日)
39

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

adobe/react-spectrum のほかの issue

adobe/react-spectrum の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。