views:

155

answers:

0

In iPad Safari, I have programmed a DIV's touch-events so that when you touch inside the DIV and hold your finger there for 500ms, the DIV's background color changes.

When I try to move the code over to a text-input element (inside a fieldset), making it the touch-target instead of the DIV, the code doesn't work. The text-input becomes selected in spite of this CSS:

    input[type=text] {-webkit-touch-callout:none; -webkit-user-select:none }

Is there no way to intercept the touch events of a text-input element in iPad Safari and handle them in a custom manner, preventing default behavior? Or is there something additional that I must do to get the input to support this? I've tried with and without a dummy click handler: onclick="void(0)".

This is the doc I'm following:

http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW7

Thanks