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

[FEAT] multiple custom breakpoints #73

Closed
CodeWithOz opened this issue Oct 10, 2020 · 6 comments
Closed

[FEAT] multiple custom breakpoints #73

CodeWithOz opened this issue Oct 10, 2020 · 6 comments
Assignees
Labels
feature New feature or request

Comments

@CodeWithOz
Copy link

What are you trying to add to Cupertino-Pane?
I would like to have the option to add multiple breakpoints through the config, and possibly (more ideal) after initialization too (similar to the .setBreakpoints() method).

Describe your feature request detailed
The middle breakpoint can be beneath the keyboard on some mobile screens. I don't want to adjust the height (to avoid moving the mid breakpoint too close to the top breakpoint) so ideally I would like to have the option to dynamically add and remove new breakpoints.

Is there an alternative at the latest version?

[ ] Yes (descripe the alternative)
[x] No

Is this related to an issue?

[ ] Yes (Give a link to the issue)
[x] No

@roman-rr
Copy link
Collaborator

@CodeWithOz Please provide some video to better understanding your needs.

@roman-rr roman-rr self-assigned this Oct 10, 2020
@roman-rr roman-rr added the feature New feature or request label Oct 10, 2020
@CodeWithOz
Copy link
Author

Not very straightforward to repro with a video so you can see the screenshots below. I have a footer that comes up with the keyboard, so I'd like to dynamically add a breakpoint that is between the mid and top breakpoints. In the first screenshot you can see the footer covering the pane when the keyboard is up.
IMG-6121

IMG-6122

@roman-rr
Copy link
Collaborator

@CodeWithOz
What do you think, we need property .translateTo(height: number). And you can set custom translate position for pane on keyboard open. When keyboard close, you can just .moveToBreak(current)
Is that solve your issue enough ?

@CodeWithOz
Copy link
Author

@roman-rr yeah I think that will definitely help in some scenarios. How would this work with the bottomClose option? For instance if I translate to 200px above the mid breakpoint and then swipe down, I want to be put back in the original mid breakpoint instead of the bottom breakpoint. It seems that even if I translate I will still be at the mid breakpoint, which will cause a downward swipe to move the bottom breakpoint (and close the drawer if bottomClose is used). In other words, I want to be able to move the sheet up above the mid breakpoint programmatically (but not to top breakpoint), but also allow swiping back to the mid breakpoint from that elevated position.

@roman-rr
Copy link
Collaborator

@CodeWithOz Released minor version 1.1.92. Now there is available to use moveToHeight(height) method.

Finally, you can try to handle like this:

keyboardOpenListener() {
  pane.moveToHeight(575);
  pane.disableDrag();
}

keyboardCloseListener() {
  pane.moveToBreak('middle');
  pane.enableDrag();
}

@CodeWithOz
Copy link
Author

Thank you! I ended up going with setBreakpoints over this, but thanks anyways!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants