Skip to content

Commit

Permalink
Remove draggability of single control item (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadayubi authored Feb 15, 2021
1 parent 59ed325 commit aef5a80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mapml/layers/MapLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ export var MapMLLayer = L.Layer.extend({
// Fixes flickering by only moving element when there is enough space
let offset = moveEvent.clientY - yPos;
moving = Math.abs(offset) > 5 || moving;
if(controls && !moving ||
if( (controls && !moving) || (controls && controls.childElementCount <= 1) ||
controls.getBoundingClientRect().top > control.getBoundingClientRect().bottom ||
controls.getBoundingClientRect().bottom < control.getBoundingClientRect().top){
return;
Expand Down

0 comments on commit aef5a80

Please sign in to comment.