Comments (13)
@jaimyborgman glitchy is not satisfaction. Quality first. :)
I guess this is exactly what you need:
<ion-item-sliding
[disabled]="slideDisabled"
(touchmove)="touchMove($event)"
(touchend)="touchEnd($event)"
(touchstart)="touchStart($event);">
...
</ion-item-sliding>
private slideDisabled: boolean = false;
private slideChecked: boolean = false;
private steps: {y: number[], x: number[]} = {y: [], x: []};
constructor() { ... }
touchStart = (e) => {
this.steps.y.push(e.targetTouches[0].screenY);
this.steps.x.push(e.targetTouches[0].screenX);
};
touchMove = (e) => {
if (this.slideChecked) return;
const coords = {
x: e.targetTouches[0].screenX,
y: e.targetTouches[0].screenY
};
const delta = {
x: coords.x - this.steps.x[this.steps.x.length - 1],
y: coords.y - this.steps.y[this.steps.y.length - 1]
};
if (Math.abs(delta.y) > Math.abs(delta.x)) {
this.slideDisabled = true;
} else {
this.locationsPane.disableDrag();
}
this.slideChecked = true;
};
touchEnd = (e) => {
this.slideDisabled = false;
this.slideChecked = false;
this.locationsPane.enableDrag();
this.steps = {x: [], y: []};
};
from panes.
Done with new setting property dragByCursor
from panes.
@jaimyborgman Currently don't have this option. I will include this option when at least 2 requests will collected here.
from panes.
@newfield86 scheduled for next version :)
from panes.
@jaimyborgman Thanks for issue.
Please record a video with bug demonstration.
from panes.
@roman-rr sure see the video here:
https://streamable.com/6z7ceb
from panes.
@jaimyborgman
Pushed new version 1.1.37 with two new methods: disableDrag()
, enableDrag()
Try to implement like this:
<ion-item-sliding (touchend)="touchEnd($event)" (ionDrag)="ionDrag($event);">
...
</ion-item-sliding>
public pane: CupertinoPane;
constructor() { ... }
ionDrag = (e) => this.pane.disableDrag();
touchEnd = (e) => this.pane.enableDrag();
from panes.
thanks for this @roman-rr it is working but not as smooth as i hoped it would be, sometimes it is still a little glitchy but way better then before!
i'm also working with ionic in combination with vue js and as per the new version of ionic there is only an ionDrag event possible currently combined it like this
const drawer = this.$parent.drawer
if (drawer.disableDragEvents) return
drawer.moveToBreak('top')
drawer.disableDrag()
setTimeout(() => {
drawer.enableDrag()
}, 500)
which is doing the job for now so thanks!
besides this; is there an option to only listen to drag event on the pane only while touching the "draggable" element of it? so that the pane only reacts on dragging from there up and down? if it isn't it would be nice to have that as a configuration option maybe? so you are able to say like drag events on the whole pane or just the draggable part?
from panes.
@roman-rr thanks for the solution
is there also an option possible to only listen to drag events on the draggable item?
would be a nice addition instead of listening on the whole drawer
from panes.
@roman-rr thanks for the solution
is there also an option possible to only listen to drag events on the draggable item?
would be a nice addition instead of listening on the whole drawer
That would be indeed a nice addition!
from panes.
many thanks @roman-rr and @newfield86
from panes.
Update notes for version > 1.1.6
- Removed
dragByCursor
options from settings - Added
dragBy
options to settings.
Now you can bind drag gestures only for cursor by adding to settings:
let settings: CupertinoSettings = {
...
dragBy: ['.pane .draggable']
};
from panes.
hi @roman-rr thanks for the update!
from panes.
Related Issues (20)
- [BUG] Incorrect processing of removing focus from input HOT 1
- [BUG] Swiperjs within pane HOT 2
- [FEAT] Playground app
- [FEAT] Modal
- [FEAT] Sounds haptics
- [FEAT] Improve touch gestures
- [BUG] Keyboard reset breakpoints to default HOT 1
- [BUG] Ionic apps required await for componentOnReady() before set event listeners HOT 9
- [BUG] Textarea with Keyboard
- [BUG] overflow-y stop working when switching pages HOT 10
- [FEAT] Update changelog & Add husky to project HOT 3
- [FEAT] Add husky to project
- [BUG] ion-select-options appear behind the pane, select itself doesnt. HOT 3
- [BUG] z-Index issue or request to set it manually. HOT 2
- [FEAT] Close all panes on hardware back button event HOT 2
- [BUG] modal appears and overlaps screen if parentElement is gone HOT 1
- [BUG] fitHeight not set height HOT 6
- [FEAT]
- [BUG] calcFitHeight need some time to calc correctly HOT 1
- [BUG] Panes cannot be dragged in Chrome HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from panes.