cubiq / iscroll

Smooth scrolling for the web
http://iscrolljs.com
MIT License
12.87k stars 3.8k forks source link

No way to focus outside input. focus out prevented by iScroll.js #1139

Open alvarotrigo opened 7 years ago

alvarotrigo commented 7 years ago

I saw it was reported in Stackoverflow too.

Reproduction online

eeeman1 commented 7 years ago

I also noticed that you can not select text, as well as select the checkbox or radio

ray007 commented 7 years ago

iScroll doesn't check the preventDefaultException for move events. I've patched this here in my local installation.

alvarotrigo commented 7 years ago

@ray007 can you elaborate that? As per the docs I can see preventDefaultExeption is set by default to

{ tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ }

What's your suggested solution?

ray007 commented 7 years ago

I IScroll's _move(e) method I changed

if ( this.options.preventDefault ) {
    e.preventDefault();
}

to

if ( this.options.preventDefault && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {  // increases performance on Android? TODO: check!
    e.preventDefault();
}

see similar checks in _start(e) and _end(e).

VictorChen commented 6 years ago

so... any updates to this? I'm having issues selecting a checkbox on mobile...