Skip to content

App crashes when attempting to input text in a UIHostingViewController that is added in a floating panel #651

@andreim-am

Description

@andreim-am

Description
The FloatingPanel does not recalculate its height when the keyboard appears. This leads to conflicting constraints and causes the application to become unresponsive until it crashes due to memory issues.

Expected behavior
The FloatingPanel should dynamically adjust its height when the keyboard appears and invalidateLayout() is called.

Actual behavior
When a text field becomes focused, the layout is invalidated, and the panel attempts to recalculate its height. However, it fails to detect the keyboard height, resulting in conflicting constraints that cause the panel to become stuck. If a hardcoded height is provided before invalidating the layout, it functions correctly without memory issues/freeze.

Steps to reproduce
Present the FloatingPanel with a swiftui view that has a text field inside.
Focus on the text field to trigger the keyboard.
Observe that the FloatingPanel does not adjust its height appropriately and eventually the app crashes.

How do you display panel(s)?
self.present()

How many panels do you display?
1

Environment
Library version: 2.8.3

Installation method: Swift Package Manager

iOS version(s): 17.5

Xcode version: 15

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions