Skip to content

iPhoneでフィードバックモーダルが一瞬で消える問題を修正 - #6039

Merged
TinyKitten merged 1 commit into
devfrom
fix/report-modal-ios-flicker
May 25, 2026
Merged

TinyKitten merged 1 commit into
devfrom
fix/report-modal-ios-flicker

Conversation

@TinyKitten

@TinyKitten TinyKitten commented May 25, 2026 •

Copy link
Copy Markdown
Member

概要

iPhone でフィードバックモーダルを開いた直後、モーダル本体だけが一瞬で消えてしまう不具合を修正します。

変更の種類

  • バグ修正
  • 新機能
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

  • iOS では TextInput の autoFocus を無効化し、CustomModal の onShow コールバック経由でアニメーション完了後にフォーカスを当てるよう変更
  • これにより、モーダルの開閉アニメーション(180ms)中にキーボード起動による KeyboardAvoidingView のレイアウト再計算が走らないようにする

背景

#6036 でフィードバックモーダルがハーフモーダルからセンタリング表示(maxHeight: '75%')に変更されたことで、autoFocus={Platform.OS === 'ios'} によってモーダル開閉アニメーションと同時にキーボードが立ち上がり、KeyboardAvoidingView のリフロー → Animated.View の opacity/scale 推移と競合してモーダルが一瞬で消えていました。以前の flex-end 配置では maxHeight 制約が効きにくく競合しなかったため顕在化していませんでした。

SavePresetNameModal で既に同様の問題を onShow 方式で解決済み(PR #5575)のため、同じパターンに揃えています。

テスト

  • npm run lint が通ること
  • npm test が通ること
  • npm run typecheck が通ること

関連Issue

スクリーンショット(任意)

Summary by CodeRabbit

  • バグ修正
    • レポート作成モーダルを表示する際のテキスト入力フィールドのフォーカス動作を改善しました。異なるプラットフォーム環境に対応した自動フォーカス処理を実装することで、各デバイスでの入力体験を最適化しました。

Review Change Stack

@TinyKitten TinyKitten self-assigned this May 25, 2026
@github-actions github-actions Bot added the react label May 25, 2026
@coderabbitai

coderabbitai Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 69dc10e8-8eb7-4e24-b14b-6f430075c6a8

📥 Commits

Reviewing files that changed from the base of the PR and between 01bfe29 and 380eaca.

📒 Files selected for processing (1)
  • src/components/NewReportModal.tsx

📝 Walkthrough

Walkthrough

NewReportModalでモーダル表示時のTextInputフォーカス制御をプラットフォーム固有に改善。iOSではモーダル表示後にコールバック経由でフォーカス、Androidではautoocusで自動フォーカスするように変更した。

Changes

プラットフォーム別TextInputフォーカス処理

Layer / File(s) Summary
プラットフォーム別フォーカス処理の実装
src/components/NewReportModal.tsx
モーダル表示時のコールバックhandleShowをiOSのみで実行してTextInputをフォーカスし、CustomModalのonShowプロップで連携させ、TextInputのautoFocusをAndroid向けに変更した。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

  • TrainLCD/MobileApp#6036: NewReportModal.tsxのCustomModal呼び出し部分をリファクタリングしており、同一ファイルの構造的な変更が含まれているため関連の可能性があります。

Suggested labels

react

Poem

iOSのキーボドよ、ふわり舞い降り、🎩✨
モーダル開きし時に、タイミング完璧に、
フォーカス制御、プラットフォーム別に、
ウサギの知恵で、スマート改善!🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PRのタイトルはiPhoneでフィードバックモーダルが消える問題という実装の主要な変更内容を正確に反映しており、簡潔かつ明確です。
Description check ✅ Passed PR説明は必須セクションをすべて含み、変更背景・理由・テスト実施状況が詳細に記述されており、テンプレート要件を満たしています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/report-modal-ios-flicker

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Comment @coderabbitai help to get the list of available commands and usage tips.

@TinyKitten
TinyKitten merged commit 5b9559f into dev May 25, 2026
6 checks passed
@TinyKitten
TinyKitten deleted the fix/report-modal-ios-flicker branch May 25, 2026 03:27
@TinyKitten TinyKitten mentioned this pull request May 25, 2026
4 of 9 tasks
@TinyKitten TinyKitten mentioned this pull request May 25, 2026
7 of 9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant