Open rsalzer opened 5 years ago
Hey @rsalzer
It seems that safari is not re-rendering / re-calculating the layers with the new clip. I could fix the problem by setting the clip to "unset", force a re-render and then set the new clip. In the _updateClip
function you need to replace the lines 132-137 with the following ones:
...
if (this._leftLayer) {
const leftContainer = this._leftLayer.getContainer()
leftContainer.style.clip = 'unset'
leftContainer.offsetWidth; // forces re-calculation
leftContainer.style.clip = clipLeft
}
if (this._rightLayer) {
const rightContainer = this._rightLayer.getContainer()
rightContainer.style.clip = 'unset'
rightContainer.offsetWidth; // forces re-calculation
rightContainer.style.clip = clipRight
}
With your fix it updates, but there is new weird behaviour:
yeah, it's also a bit hacky. I think this plugin needs a few changes but it seems unmaintained.
Dragging with one finger touch in iOS (both safari and chrome for iOS)doesn't work, either. You can only drag using two finger like zooming in/out.
fixed with clip-path instead of clip. https://github.com/Aaronliu2016/leaflet-side-by-side/blob/4d3b2d678848f1cdf78b3c6749de81028c7d3e83/index.js#L121
Did you do a PR already? ;)
Nope, because I only tested it on iOS 13.+ and Mac OS X, Not sure if this fix works properly on other devices. :P
Do you have a working example? I used your js and it still does not seem to work in my Safari on mac.
Did you found the way to fix it? I tried Aaron's js but its not work
Unfortunately not :(
Does anyone have a clue how to fix it? It would be a shame if we can not use the plugin in safari ...
Two commits before ... it seemed to still work. This version here: https://github.com/digidem/leaflet-side-by-side/tree/290b4482dac0d681ec188e8dcce1a4b746f1a6f0 Maybe someone can figure out, whats the difference...?
In Safari 12.1.1 on the Mac dragging does not work anymore. You can reproduce it with the Live example.