ftlabs / fastclick

Polyfill to remove click delays on browsers with touch UIs
MIT License
18.66k stars 3.23k forks source link

“Fastclick.js” cause the cursor of “textarea” cann't be located in the text and select the text,Why? #428

Open ichenglixue opened 9 years ago

ichenglixue commented 9 years ago

"Fastclick.js" cause the cursor of "textarea" cann't be located in the text and select the text,Why???

    <textarea  placeholder="<?= $ret['reply'] ? '' : '分享新观点'; ?>" id="comment-content"  class="fs-16 bg-fff" oninput="chkInput()" onpropertychange="chkInput()"><?= isset($ret['topic']) ? $ret['topic'] : "" ?><?= $ret['content']; ?></textarea>

I add the class "needsClick" or "needsFocus" or "noFastclick": class="needsClick fs-16 bg-fff" 、class="needsFocus fs-16 bg-fff" 、class="noFastclick fs-16 bg-fff"、name="noFastclick"

But all these doesn't work.

How to make "fast click" not affect the textarea???

kukikiloke commented 8 years ago

You can still select the text and change your cursor position but it requires you to tap and hold a bit a few hundreds milliseconds instead of a quick tap for it to work.

You can refer to this https://github.com/ftlabs/fastclick/pull/310 if that's not the behaviour you wanted.