Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Submit buttons not clickable #561

Closed
jordif opened this issue Dec 19, 2013 · 7 comments
Closed

Submit buttons not clickable #561

jordif opened this issue Dec 19, 2013 · 7 comments

Comments

@jordif
Copy link

jordif commented Dec 19, 2013

Hi,

first, thanks for this great plugin!

When I use iscroll 5 with "click: true", i can click on links and input fields, but not on submit buttons.

Any ideas how to fix this?

Thanks!

Jordi

@jordif
Copy link
Author

jordif commented Dec 19, 2013

So I've solved this by editing line 1543 (version 5.0.9):

if ( !e._constructed ) {

I've changed it to:

if ( !e._constructed && target.tagName != 'INPUT' ) {

Honestly, I'm not quite sure I fully understand what this code does, but the e.preventDefualt inside the if condition was preventing the form from being sent (also, this code only seems to affect input fields when option "click" is true...)

hope this helps someone :)

@cubiq
Copy link
Owner

cubiq commented Dec 19, 2013

maybe it would be better:

if ( !e._constructed && target.type != 'submit' ) {

I haven't checked it but should work.

I'll try to work with forms as soon as possible.

@jordif
Copy link
Author

jordif commented Dec 19, 2013

Hi Matteo,

you're right, I think it's better and it works :)

Thanks for your time and awesome work!

Biggerskimo added a commit to Biggerskimo/iscroll that referenced this issue Jan 25, 2014
@tomasdev
Copy link

tomasdev commented May 4, 2014

Is this fixed in iScroll 5? Doesn't seem so.

Line 223: if ( !(/(SELECT|INPUT|TEXTAREA)/i).test(target.tagName) ) {
Line 1555: if ( !e._constructed ) {

Basically if it's an input, it won't trigger the MouseEvents with _constructed, therefore being cancelled as click on the normal click event when click: true

My fix: line 1555, add && !(/(SELECT|INPUT|TEXTAREA)/i).test(e.target.tagName) before closing the parenthesis.

@nowen-a10
Copy link

@tomasdev That fixed my problem on Android devices running kitkat. Thanks!

abstraktor added a commit to abstraktor/iscroll that referenced this issue Jul 30, 2014
@thehappycoder
Copy link

Thank you for the fix! I applied it in my project that uses iscroll 5. Initially I thought I should be using tap: true instead but later discovered more problems like rails_ujs not working with tap.

@amitchoubey
Copy link

@cubiq I applied changes which you told & its working but I am getting error in log ie. "target is not defined "

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

7 participants