答案 0 :(得分:0)
好像有一个新的passive option可以传递给事件处理程序,这将改善滚动并使警告静音。这是bit more information。
示例实现:
$(document).ready(function(){
var x = 5;
document.querySelector('#add-select').addEventListener('click', function (e) {
for(var n = 0; n < x; ++ n) {
$('.dynamic-select').append('<div class="s"><select><option value="' + n + '">' + n + '</option></select></div>');
}
}, {passive: true})
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div>
<button type="button" id="add-select">Add Select</button>
</div>
<div class="dynamic-select"></div>