Skip to content

Commit

Permalink
Prevent dismiss gesture issue #87 + release 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-rr committed Dec 14, 2020
1 parent ad34c3a commit 76d821a
Show file tree
Hide file tree
Showing 12 changed files with 149 additions and 51 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,32 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### BREAKING CHANGES
- Improved `.preventDismiss()` method and gesture [#87](https://github.com/roman-rr/cupertino-pane/issues/87)
```javascript
const settings = {
...
onWillDismiss: (e) => {
if (e) {
console.log(e.prevented);
}
}
}

const myPane = new CupertinoPane('.cupertino-pane', settings);
myPane.present({animate: true});
myPane.preventDismiss(true);
```

### Bug Fixes
- Fixed `setBreakpoints()` method for inversed pane [#92](https://github.com/roman-rr/cupertino-pane/issues/92)
- Fixed `textarea` overflow scroll. Pane disallowed from drag if scroll available and target element is textarea [#88](https://github.com/roman-rr/cupertino-pane/issues/88)
- Fixed horizontal scroll inside pane [#102](https://github.com/roman-rr/cupertino-pane/issues/102)
- Fixed keyboard issues on Android devices with cordova webview
- Fixed drag event and stops laggy on drag pane with touchAngle option [#102](https://github.com/roman-rr/cupertino-pane/issues/102)
- Fixed `onTransitionEnd` callback with top position [#105](https://github.com/roman-rr/cupertino-pane/issues/105)
- Fixed `currentBreak()` detection for `onDragEnd` callbac [#106](https://github.com/roman-rr/cupertino-pane/pull/106)
- Fixed height calculation for overflow element [#104](https://github.com/roman-rr/cupertino-pane/issues/104)

## [1.1.94] - 2020-11-15

Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,19 +296,24 @@ myPane.setBreakpoints({
bottom: { ... }
});
```
### preventDismiss()
Using in pair with `onWillDismiss()` callback to prevent pane from destroy on custom conditions
### preventDismiss(**boolean = false**)
Use this method to prevent dismiss events. Use `onWillDismiss()` callback to listen if dismiss event prevented.
```javascript
const settings = {
...
onWillDismiss: () => {
if (disallowDismiss) {
drawer.preventDismiss();
onWillDismiss: (e) => {
if (e) {
console.log(e.prevented);
}
}
}

const myPane = new CupertinoPane('.cupertino-pane', settings);
myPane.present({animate: true});
myPane.preventDismiss(true);
```


## Attributes
### hide-on-bottom
Set for element to automaticaly hide on reach bottom breakpoint.
Expand Down
5 changes: 3 additions & 2 deletions dist/cupertino-pane.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export declare class CupertinoPane {
screen_height: number;
private screenHeightOffset;
private rendered;
private preventDismissEvent;
preventDismissEvent: boolean;
preventedDismiss: boolean;
private iconCloseColor;
private brs;
wrapperEl: HTMLDivElement;
Expand Down Expand Up @@ -71,7 +72,7 @@ export declare class CupertinoPane {
/**
* Prevent dismiss event
*/
preventDismiss(): void;
preventDismiss(val?: boolean): void;
/**
* Disable pane drag events
*/
Expand Down
53 changes: 38 additions & 15 deletions dist/cupertino-pane.esm.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cupertino-pane.esm.bundle.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 38 additions & 15 deletions dist/cupertino-pane.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 76d821a

Please sign in to comment.