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

on-hold directive not working in ion-slide-box #2373

Closed
marcsyp opened this issue Oct 9, 2014 · 23 comments
Closed

on-hold directive not working in ion-slide-box #2373

marcsyp opened this issue Oct 9, 2014 · 23 comments
Assignees

Comments

@marcsyp
Copy link

marcsyp commented Oct 9, 2014

With the recent update to Android 4.4.4, the on-hold directive is no longer working consistently. I am using the nightlies with the refactored slide-box (as of yesterday), this does not solve the issue.

I am able to engage the tap-hold only maybe 1 in 5 tries, or even 1 in 20 to 30 in some cases. I have put together a sample project with an ng-repeat of a number of items within a single slide. I suspect that vertical scroll may have something to do with it, but I don't see any docs on disabling the scroll within a slide to test.

You can find the project here:

https://drive.google.com/file/d/0B1ClGdseCfJdS09XN3JfbXp2Ykk/view?usp=sharing

Thanks.

@marcsyp
Copy link
Author

marcsyp commented Oct 9, 2014

Reference this issue, now closed:

#2317

@marcsyp
Copy link
Author

marcsyp commented Oct 11, 2014

Related to gesture detection problems in Android 4.4?

#2115

@marcsyp
Copy link
Author

marcsyp commented Oct 11, 2014

UPDATE:

I tried disabling the scrolls for all ion-content using scroll="false". I got some interesting results.

Tap hold works every other time, consistently. That is, between each tap-hold event there needs to be another event (like a tap or swipe) before the tap-hold will work again.

Doing all tap-holds in a row results in tap-hold, click, tap-hold, click, tap-hold, click, etc. I suspect something about the tap-hold event is not resolving at the end which causes the next tap-hold to fail.

Again, this is with all scrolls disabled. With scrolls enabled the problem is much worse and less predictable, so there is additional element at play there.

Please let me know how if you have any updates, once again my app is dead in the water until this is resolved. Thanks again for all your hard work!

Marc

@marcsyp
Copy link
Author

marcsyp commented Oct 18, 2014

Any news on this? In order to work around it I will have to change the UI paradigm of my app significantly. Please let me know if there is someone taking a look at this.

Thanks,
Marc

@marcsyp
Copy link
Author

marcsyp commented Oct 27, 2014

Is anybody else having this problem or is it just me?

@drewrygh
Copy link
Contributor

drewrygh commented Nov 2, 2014

Looking in to this right now.

@marcsyp
Copy link
Author

marcsyp commented Nov 2, 2014

Fantastic! Happy to hear it.

@drewrygh
Copy link
Contributor

drewrygh commented Nov 3, 2014

Alright, so I didn't get a chance to go through your code to see what was causing the problem, but I believe it might have to do with how you have nested ion-content elements. I found it easier to just have ion-content / ion-scroll inside each slide. Also, having ng-click and on-click both defined may be causing the event to not resolve properly.

Anyway, I isolated the on-hold directive a bit more here here, and everything appears to be working. Tested on android as well:

ionic start ionicOnHoldTest http://codepen.io/drewrygh/pen/jkgeL
ionic platform add android
ionic build android

Can you try updating to the latest nightly, removing the ng-click, and replacing your outer ion-content with ion-pane? I'm running Android 4.4.4 and my codepen seemed to work. Maybe you can confirm this?

@drewrygh
Copy link
Contributor

drewrygh commented Nov 3, 2014

As a side note, while building the example, I was experimenting with on-doubleclick. The event appears to never fire, so I'll have to file a separate bug report.

The interesting part is that when I use $ionicGesture.on() to manually handle the doubleclick event, it successfully detects the doubleclick, but it creates the exact same problems you're running into here (the scope will not update unless another event is fired, just as you describe.)

@marcsyp
Copy link
Author

marcsyp commented Nov 3, 2014

Hm. No success here. First, I'm not sure what you mean by "having ng-click and on-click defined". I do not have them defined on the same element, or on parent/child elements. Also, this code has been working in the past, so I'm not sure what the issue would be.

I tried replacing the outer content with a pane and the inner contents with scrolls. It didn't solve my tap-hold problems and now my slides don't scroll. Your codepen has the same problem. Add content to your slides to make it longer than a single screen and you will see that it doesn't scroll properly.

Are you using an actual device, or just the simulator?

Everything works fine in my simulator, it's when I use on a device that I have the problems.

Thanks,
Marc

@marcsyp
Copy link
Author

marcsyp commented Dec 9, 2014

Just an FYI, this is still a problem for me. Also, I tested on a Nexus 5 with Android 5.0 and the tap-hold problem exists there as well.

Marc

@marcsyp
Copy link
Author

marcsyp commented Dec 9, 2014

Add'l info to clarify. The tap-hold issue only exists inside a slide-box. Outside a slide-box, it seems to work fine.

Marc

@mhartington
Copy link
Contributor

Hey @marcsyp, so I tested things out using this codepen as a basis.
http://codepen.io/mhartington/pen/xbZmOb

I was able to get the on-hold event to fire with out any issues.
Tested on a 4.1 moto electrify.

@marcsyp
Copy link
Author

marcsyp commented Dec 9, 2014

Yeah, it works on my old Droid RAZR MAXX as well. The problem only exists on Android 4.4.4 and up.

@SashaGeekette
Copy link

Yes. Happening to me. I use on-hold on my 4.4.2 and iOS devices and works fine, but on 4.4.4 nothing happens.I am using it on a div within an ion-content

@marcsyp
Copy link
Author

marcsyp commented Feb 10, 2015

I noticed that some of the other touch event issues are being closed with recent updates. This one is still open, and it is my primary problem with my app right now. Basically halted development for several months. Any updates? If there is a fix by moving to latest nightly and Crosswalk, etc, I will make the effort to upgrade (I'm stuck in Beta13, I believe).

Thanks,
Marc

@adamdbradley adamdbradley self-assigned this Feb 11, 2015
@SashaGeekette
Copy link

@marcsyp Suggest using mnTouch if updates dont' work. We are using that for on-hold right now and it works great.

@marcsyp
Copy link
Author

marcsyp commented Feb 12, 2015

Thanks. Any specific notes on implementing this in Ionic? Do I need to rip out anything from the Ionic bundle that will conflict? I'm not an expert, still working my way around these kinds of custom mods.

Thanks,
Marc

@SashaGeekette
Copy link

No. We just got an mnTouch from its git repository and used the appropriate attribute on the tag we were interested in listening to. I think if you have an additional event such as a click on the same element you want to use mnTouch for both events. We didn't touch Ionic at all, just used mnTouch where we had problems.

-----"Marc Syp" [email protected] wrote: -----

=======================
To: "driftyco/ionic" [email protected]
From: "Marc Syp" [email protected]
Date: 02/11/2015 07:27PM
Cc: SashaGeekette [email protected]
Subject: Re: [ionic] on-hold directive not working in ion-slide-box (#2373)

Thanks. Any specific notes on implementing this in Ionic? Do I need to rip out anything from the Ionic bundle that will conflict? I'm not an expert, still working my way around these kinds of custom mods.

Thanks,
Marc


Reply to this email directly or view it on GitHub:
#2373 (comment)
This message has been scanned and no issues discovered.

To report this email as SPAM, please forward it to [email protected]

@SashaGeekette
Copy link

Please see: #1729 (comment)

-----"Marc Syp" [email protected] wrote: -----

=======================
To: "driftyco/ionic" [email protected]
From: "Marc Syp" [email protected]
Date: 02/11/2015 07:27PM
Cc: SashaGeekette [email protected]
Subject: Re: [ionic] on-hold directive not working in ion-slide-box (#2373)

Thanks. Any specific notes on implementing this in Ionic? Do I need to rip out anything from the Ionic bundle that will conflict? I'm not an expert, still working my way around these kinds of custom mods.

Thanks,
Marc


Reply to this email directly or view it on GitHub:
#2373 (comment)
This message has been scanned and no issues discovered.

To report this email as SPAM, please forward it to [email protected]

@adamdbradley
Copy link
Contributor

This issue has been fixed with the most recent updates to nightly. Tested Android 4.4.4.

@marcsyp
Copy link
Author

marcsyp commented Feb 15, 2015

Great! This actually worked for me, too. It requires some messing with the default thresholds to get right when you're inside a slide box and using other interactions, but it is MUCH better than the broken interactions I had before.

Thanks!

Marc

@DEllingsworth
Copy link

This seems to still be broken. I tested this today on an s5 running 4.4.4. Using mnTouch still solved the issue for us.

It DOES work fine for 4.4.2 (s4) and 5.0.1 (Nexus 9)
Codepen here:
http://codepen.io/dellingsworth/pen/JopVRB

-Don

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants