HTML 输入文本字段不起作用

HTML input text field doesn't work

我目前正在制作基于传单的地图。所有输入类型的文本现在都不起作用。点赞:

<input type="text" placeholder="Search" id="search-input" autocomplete="off">

文本框显示在页面上,但无法点击或输入文本。如果我删除文件 "leaflet.js",文本框工作正常,但所有其他内容同时消失。

传单示例:

var world_map =L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
    attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
    maxZoom: 18
});
var map = L.map('map',{
    center:[50.979, 11.322], 
    zoom:6,
    layers:world_map
});

有人知道问题出在哪里吗?

leaflet.js 内部,可能有什么东西让它被禁用了。我能想到的解决办法就是用你自己的代码覆盖它:

<script> 
    document.getElementById("search-input").disabled = false
</script>

根据 leaflet.js documentation:

el = document.getElementById('search-input');
L.DomEvent.disableClickPropagation(el);