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

Issue with input field in swiper #279

Merged
merged 1 commit into from
Jul 23, 2013

Conversation

mattdemps
Copy link
Contributor

Even if "releaseFormElements" is set to true the the input field has to be tapped twice to give focus. This is because the first tap is being registered as a "mousedown" event and not a "touchstart" event (Tested on iOS 6/7 & chrome with touch events enabled). I put in a check where you are checking for a touch event to see if we are releasing form elements and if the element is an input field. I have not checked to see if other form elements have this same issue, for my purposes I had to make this change. If you see a better way of implementing this check, feel free to make the change.

Even if "releaseFormElements" is set to true the the input field has to be tapped twice to give focus.  This is because the first tap is being registered as a "mousedown" event and not a "touchstart" event (Tested on iOS 6/7 & chrome with touch events enabled).  I put in a check where you are checking for a touch event to see if we are releasing form elements and if the element is an input field.  I have not checked to see if other form elements have this same issue, for my purposes I had to make this change.  If you see a better way of implementing this check, feel free to make the change.
nolimits4web added a commit that referenced this pull request Jul 23, 2013
Issue with input field in swiper
@nolimits4web nolimits4web merged commit e324efd into nolimits4web:master Jul 23, 2013
@nolimits4web
Copy link
Owner

Merged, thanks

@nolimits4web
Copy link
Owner

But i think along with input there should be also mentioned select and textarea?

@mattdemps
Copy link
Contributor Author

I think it would be safe to assume textareas would function the same, I can't say if selects would incur a mousedown event, I would have to do some testing around that. Also, the srcElement may not work in some older browsers, most notably older Firefox browsers, you may need to use event.target in these cases. Might need to do a check for support in the IF or write a helper.

@mattdemps mattdemps deleted the patch-1 branch July 24, 2013 11:27
@57u
Copy link

57u commented Nov 29, 2013

I've just run into this issue. Cannot type into inputs or textareas on ios7 when using a form in a swiper (even with releaseFormElements:true).

As johnwest80 says, it works if you click the input twice, so I have bodged around it with a little jquery:

$('input, textarea', '#requestForm').on('mousedown', function()
{
$(this).focus();
});

@lock
Copy link

lock bot commented Jun 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the outdated label Jun 25, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jun 25, 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

Successfully merging this pull request may close these issues.

None yet

4 participants