ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Gesture instance options are ignored when $ionicGesture is used

Open blixt opened this issue 12 years ago • 6 comments

This affects even "pure" ionic.Gesture instances somehow.

Example: http://codepen.io/blixt/pen/zqmjL

The above will clearly execute closer to 500 ms after touch, rather than 10 ms as was specified in the custom options. Also, the distance threshold is provably still 1px, not 15px. Once the use of $ionicGesture is removed, the rest of the code works as it's supposed to.

blixt avatar Sep 29 '14 00:09 blixt

I have already added a code example demonstrating this bug. I just tried it with v14 of the Ionic 1.0 beta and the bug appears to still be there.

blixt avatar Jan 18 '15 02:01 blixt

Is this still an issue in the nightly builds?

Ionitron avatar Apr 21 '15 19:04 Ionitron

Yes, here is the same bug exhibited using the nightly build: http://codepen.io/anon/pen/bdGVzq

This is the last time I will respond to automatic warnings on this issue, I feel like it's time poorly spent.

blixt avatar Apr 21 '15 19:04 blixt

Alright I see the issue. So this works if you declare the options before $ionicGesture

http://codepen.io/mhartington/pen/OVMbgW

mhartington avatar May 08 '15 21:05 mhartington

That is a fair workaround but is this not still a bug? The documentation states that I may pass in options and I pass in the following:

var options = {hold_threshold: 15, hold_timeout: 10};
var gesture = new ionic.Gesture(button, options);

Now if I configure the timeout to be 10ms and it's ignoring that option without warning – isn't it still a bug?

blixt avatar May 09 '15 00:05 blixt

@mhartington I modified a bit of code, the target of the event changed to the header bar. http://codepen.io/sanmao/pen/PPqXvB In the original version, hold event triggered at 15ms, in a modified version, hold events triggered in 500ms, which is hold_timeout default value. This is a bug it?

Thanks.

sanmaozhao avatar Sep 09 '15 09:09 sanmaozhao