Open glister opened 4 years ago
Thank you for your donation :)
And it seems a bug. Please specify hidden
or scroll
instead of auto
. I will fix this bug in the next version.
One tip. This plugin checks all position, dimension, and some CSS properties to detect the touch position. So, if the list has bunch of child elements, the performance goes down.
To prevent this, please use ShadowDom
For example, there is a list like this.
<style>
.list {
width:300px;
height:300px;
overflow-y:scroll
}
.list-item {
width: 100%;
height: 50px;
}
</style>
<div class="list">
<div class="list-item">item</div>
<div class="list-item">item</div>
<div class="list-item">item</div>
..... (repeat 100000 items)
<div class="list-item">item</div>
</div>
If you use shadowDom, this plugin does not inspect inside the element.
<div class="list" id="list"></div> <--- Maps plugin checks only this element
<script>
var list = document.getElementById("list");
var container = list.attachShadow({mode: 'open'}); // or 'close'
for (var i = 0; i < 100000; i++) {
var item = document.createElement("div");
item.addClasses("list-item");
container.appendChild(item);
}
</script>
In this case, this plugin can reduce the number of checking elements significantly.
Thanks @wf9a5m75 , Using overflow-y: scroll
didn't seem to fix the problem, but using shadowDom solves the problem.
Look forward to the next version 👍
Firstly, thank you for this plugin, it's worked great for us for years! I appreciate your hard work and have donated using the link below 👍
I'm submitting a ... (check one with "x")
OS: (check one with "x")
cordova information: (run
$> cordova plugin list
)Current behavior: If the map container div has a fixed height div beneath it which has overflow-y: auto and the content inside that div is scrolled down you can no longer interact with the map. It seems to be related to the plugin's ability to detect whether HTML content is over the map (i.e. zindex), it thinks the content in the div beneath it which is scrolled (but not visible because overflow) is actually over the map so touch gestures don't get through to the map.
Expected behavior: The map should be interactive when no HTML content is above the map container.
Screen capture or video record:
Inspecting with safari shows the hidden list items that are scrolled out of the overflow
Related code, data or error log (please format your code or data):
The code is the Hello World example with a little bit of extra HTML and CSS
Support this plugin activity Supported!