Toolbar disappears from SwiftUI TextField after a popup is closed

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

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
56/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
ios, swift
領域
mobile

調査の方向性

Start by tracing how IQKeyboardToolbarManager attaches and restores its toolbar for a SwiftUI TextField hosted in UIHostingController, then compare that lifecycle with UIKit during modal dismissal. Reproduce the reported sequence on iOS 26.6.1 with IQKeyboardManagerSwift 8.0.3 and inspect relevant toolbar tests or notifications. Done when the toolbar remains visible after dismissal and the number pad can still be closed.

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

説明

Describe the bug
In a SwiftUI screen, I tap a text field and the toolbar with the Done button shows above the keyboard as expected.

Then a popup opens while I'm typing, and the keyboard hides. When I close the popup, the keyboard comes back with the toolbar, but after a split second the toolbar disappears. The Done button is gone, and with a number pad there's no way to close the keyboard.

The toolbar only comes back if I close the keyboard some other way and tap the text field again.

This doesn't happen on UIKit screens. Only SwiftUI text fields lose the toolbar.

To Reproduce
Steps to reproduce the behavior:

  1. Enable the toolbar: IQKeyboardToolbarManager.shared.isEnabled = true
  2. Show a SwiftUI view with a TextField inside a UIHostingController
  3. Tap the TextField. IQ's toolbar appears
  4. While the field is still editing, present a modal view controller over the screen (we use a custom-presented popup). The keyboard hides, but the field stays first responder
  5. Dismiss the modal
  6. See error: the keyboard comes back with the toolbar, then the toolbar disappears a moment later. It stays gone until the user ends editing and taps a field again

Expected behavior
The toolbar stays visible after the modal is dismissed

Screenshots
Demo Project

Versions

Xcode: 26.3
Mac OS: 26.5
Simulator/Device: iOS 26.6.1
Simulator/Device Name: iPhone 13
Library Version: IQKeyboardManagerSwift 8.0.3, IQKeyboardToolbarManager 1.1.6 (IQKeyboardToolbar 1.1.5, IQKeyboardCore 1.0.9, IQTextInputViewNotification 1.0.9)

Additional context
UIDesignRequiresCompatibility = YES

主要言語
Swift
スター
16.6k
フォーク
2.4k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

hackiftekhar/IQKeyboardManager のほかの issue

hackiftekhar/IQKeyboardManager の issue をすべて見る

似ている issue

Swift の issue をもっと見る

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

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