jquery mobile+iscroll can not enter any information when using data-filter together

 

Recently, I came into contact with jquery moblie in a mobile project. The project requires the use of jquery mobile listview +iscroll to achieve regional scrolling.
But in the process of doing it, I found a problem. The use of iscroll and jquery mobile together will cause the filter to not be used. As a result, I searched the Internet for a long time, and finally a friend in a group told me:
Because I want to simulate the scrolling of the browser through the touch event, iscroll prevents all browser default actions in the scrolling area and causes the input box focus to be inaccessible.
Solution:
When iscroll is initialized, register the following methods to exclude elements that require browser default actions

js code

		onBeforeScrollStart: function(e) {
			var target = e.target;
			while (target.nodeType != 1) target = target.parentNode;
			if (target.tagName != 'SELECT' && target.tagName != 'INPUT' && targ                           et.tagName != 'TEXTAREA' && target.tagName != 'BUTTON'){
				 e.preventDefault();
				}
	}

 

 

Guess you like

Origin blog.csdn.net/jia_dojo/article/details/84487256