Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dragging not working in newest Safari #28

Open
rsalzer opened this issue Jul 7, 2019 · 12 comments
Open

Dragging not working in newest Safari #28

rsalzer opened this issue Jul 7, 2019 · 12 comments

Comments

@rsalzer
Copy link

rsalzer commented Jul 7, 2019

In Safari 12.1.1 on the Mac dragging does not work anymore. You can reproduce it with the Live example.

@moklick
Copy link

moklick commented Oct 22, 2019

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
    }

@rsalzer
Copy link
Author

rsalzer commented Oct 22, 2019

With your fix it updates, but there is new weird behaviour:

  • Sometimes both sides show the same map
  • Sometimes only one side scrolls, the other stays untill the separator is dragged...

@moklick
Copy link

moklick commented Oct 23, 2019

yeah, it's also a bit hacky. I think this plugin needs a few changes but it seems unmaintained.

@Aaronliu2016
Copy link

Aaronliu2016 commented Nov 29, 2019

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.

@Aaronliu2016
Copy link

Aaronliu2016 commented May 30, 2020

@rsalzer
Copy link
Author

rsalzer commented Jun 1, 2020

Did you do a PR already? ;)

@Aaronliu2016
Copy link

Nope, because I only tested it on iOS 13.+ and Mac OS X, Not sure if this fix works properly on other devices. :P

@rsalzer
Copy link
Author

rsalzer commented Jun 2, 2020

Do you have a working example? I used your js and it still does not seem to work in my Safari on mac.

@biennui1998mu
Copy link

Did you found the way to fix it? I tried Aaron's js but its not work

@rsalzer
Copy link
Author

rsalzer commented Dec 29, 2020

Unfortunately not :(

@rsalzer
Copy link
Author

rsalzer commented Mar 1, 2021

Does anyone have a clue how to fix it? It would be a shame if we can not use the plugin in safari ...

@rsalzer
Copy link
Author

rsalzer commented Mar 1, 2021

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...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants