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

HeaderHeight calculation pushes Header further down with each show #7

Closed
caffeineflo opened this issue Oct 24, 2018 · 7 comments
Closed
Labels
bug Something isn't working

Comments

@caffeineflo
Copy link

The premise is relatively simple, looking at https://github.com/antoniocasero/Panels/blob/master/Sources/Panels.swift#L50 the safeAreaBottom is added to the PanelHeightConstraint every time show is being executed.

Now in my specific use case, I instantiate the Panelable VC with my parent VC and only show the Panel on didSelect, I dismiss it on didDeselect. With this behavior, the headerHeigh grows every time I execute show which ends up pushing my header further down each time.
The examples show the same behavior (although, it's constraints break and recovery recovers the correct constraints).

@antoniocasero
Copy link
Owner

Yes, this is a use case that I didn't contemplate. It happens when the panel is reused to be shown/dismissed. I have a solution in mind, I will push a fix this weekend.
Thanks for reporting 👍

@antoniocasero antoniocasero added the bug Something isn't working label Oct 26, 2018
@antoniocasero
Copy link
Owner

Please @caffeineflo, reopen if you still have problems

@caffeineflo
Copy link
Author

caffeineflo commented Oct 29, 2018

I'll try it tomorrow morning and report back. Thanks for the quick turnaround!

@caffeineflo
Copy link
Author

@antoniocasero I might be missing some configuration to make this work.
But when I click the panel now, it won't scroll up... I'll add a gif to it that makes it more clear

@antoniocasero
Copy link
Owner

antoniocasero commented Oct 30, 2018 via email

@caffeineflo
Copy link
Author

I instantiate the panel with the VC, so e.g. let panel = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "Panel") as! PanelClass (PanelClass conforms to Panelable). Now on didSelect I show the panel and on didDescelect I dismiss the panel.
See gif for the behavior this ends up giving me
panels

@antoniocasero
Copy link
Owner

Sorry I can not reproduce this issue. Maybe some missing values in the PanelConfiguration?
Could you check what is the value in the method -movePanel(_:) when you tap on the panel?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants