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

BUG:Click event not fired on some android devices #1203

Open
KVVat opened this issue May 8, 2018 · 4 comments
Open

BUG:Click event not fired on some android devices #1203

KVVat opened this issue May 8, 2018 · 4 comments

Comments

@KVVat
Copy link

KVVat commented May 8, 2018

I found click event not fired on my android device.(samsung galaxy note/android 7).
Because some devices calls 'touchmove' event when you tapping.
So, I add below code on 'touchMove' event function and works fine.

1196:slider.hasMove=true

if((xMovement+yMovement)>=1.2){ slider.hasMove = true;}

Regards

@robbie-cahill
Copy link

robbie-cahill commented May 22, 2018

Whats seems to be happening here is the touchStart event on bx-viewport seems to be intercepting the "click" event. For me, this stops a link within the viewport being tappable. Tap the link, nothing happens.

If I remove (using chrome devtools) the touchStart event on bx-viewport, I can tap my link again and it works normally.

On the desktop, the link can be clicked and behaves normally.

robbie-cahill pushed a commit to robbie-cahill/bxslider-4 that referenced this issue May 22, 2018
@robbie-cahill
Copy link

robbie-cahill commented May 22, 2018

Note that my commit here is based on the latest stable tag, v4.2.15 since I plan to use the fork in my own project (without also using untested code) until my upcoming pr is merged into a stable release here. It only fixes the problem for links by stoping e.preventDefault() if the element being clicked has a href attribute.

robbie-cahill pushed a commit to robbie-cahill/bxslider-4 that referenced this issue May 22, 2018
@robbie-cahill
Copy link

PR: #1204

@Morrison75
Copy link

I experienced the same problem using a Galaxy Tablet S2 version 7.0.

Here's the hack which allows users to access the links:

`export default function () {
const $slider = $('.js-slider-brands');

return _init()

function _init() {
	if (!$slider.length || $('.js-slider-brands .item').length <= 1) {
		return;
	}
	
	$slider.bxSlider({
		pager: false,
		slideWidth: 390,
		minSlides: 1,
		maxSlides: 5,
		moveSlides: 1,
		slideMargin: 10,
		infiniteLoop: false,
		hideControlOnEnd: true
	});

	
	$slider.closest('.bx-viewport').on('touchstart',function(ev){
		const $image = $(ev.target);
			$image.closest('a').trigger( "click" );
	})

}

}`

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

No branches or pull requests

3 participants