Skip to content

Popup content view rebuilds multiple times when keyboard appears #274

@videni

Description

@videni

Description

When a popup contains a TextField and the keyboard appears, the popup content view is rebuilt multiple times, causing visual jumping/flickering.

Steps to Reproduce

  1. Create a popup with a TextField inside
  2. Tap the TextField to show the keyboard
  3. Observe the console logs - the popup content view's body is executed multiple times

Expected Behavior

The popup content view should not be rebuilt when the keyboard appears. It should only adjust its position smoothly.

Actual Behavior

The popup content view is rebuilt 5+ times in rapid succession when the keyboard appears, causing:

  • Visual jumping/flickering
  • Loss of any non-@State local variables
  • Poor user experience

Since iOS can send multiple keyboard notifications during a single keyboard show/hide animation, this causes multiple view updates.

Environment

  • PopupView version: 4.x
  • iOS version: 16+
  • Xcode version: 15+

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions