Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug/Feature Request] Increase priority of Layout.interactionConstraint #424

Closed
Argent opened this issue Jan 2, 2021 · 2 comments
Closed

Comments

@Argent
Copy link
Contributor

Argent commented Jan 2, 2021

Description

I have the requirement that my floating panel always displays a button at the bottom of the sheet. If the panel size is increased (dragged up) the button should stay at the bottom of the screen.
To achieve this I'm using fpc.contentMode = .fitToBounds to fit the content of my custom ViewController to the size of the panel.

However with fitToBounds it prevents my panel from being dragged out of the screen in the bottom direction.

I found out that the reason for this is the priority of Layout.interactionConstraint which is set to .defaultHigh. If the priority is set to .required everything works as expected.

Unfortunately the constraint is not accessible from outside the framework and thus its not easy to change the priority.

It would be good to change the priority to .required for default or at least make it configurable.

Expected behavior

I can drag the panel in bottom direction even if .fitToBounds is enabled

Actual behavior

The priority of interactionConstraint is too low so that the VCs intrinsic height blocks the panel from being dragged in bottom direction

Actual behavior Expected behavior
2021-01-02 10 04 40 2021-01-02 10 05 11
@scenee
Copy link
Owner

scenee commented Jan 6, 2021

Thank you for your request. I agree that its priority will be set to .required. I supposed that . defaultHigh priority would reduce the layout problem, but I was wrong.

scenee added a commit that referenced this issue Jan 9, 2021
…tionConstraint

I applied `.defaultHigh` priority which might be safe to prevent
an ambiguous layout error. But that causes this issue, so I have to
use `.required` priority.

See more detail [#424
issue](#424).
scenee added a commit that referenced this issue Jan 11, 2021
…tionConstraint (#428)

I applied `.defaultHigh` priority which might be safe to prevent
an ambiguous layout error. But that causes this issue, so I have to
use `.required` priority.

See more detail [#424
issue](#424).
@scenee
Copy link
Owner

scenee commented Jan 11, 2021

I've updated the priority to .required at #428. You save me. Thank you so much.

@scenee scenee closed this as completed Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants