Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

slide to close not working. #169

Open
Dramex opened this issue Aug 24, 2018 · 12 comments
Open

slide to close not working. #169

Dramex opened this issue Aug 24, 2018 · 12 comments

Comments

@Dramex
Copy link

Dramex commented Aug 24, 2018

Hi,

in the demo i can slide the sidebar with my finger to close it. but i cant do that in with the example Responsive sidebar code.
both overlay click / close function works fine.

what the problem here.

@markusenglund
Copy link
Collaborator

markusenglund commented Aug 24, 2018

Hi,
The example still uses an old version of the library (2.3.2). I should fix that. In the new version (3.0) touch sliding have been disabled on IOS devices since horizontal sliding causes changes to browser history. See #67.

Which iPhone or ipad are you currently using? Do you think swiping right to left should be enabled? I don't have an iPhone on me right now, so I can't check the exact behaviour. It might have been a mistake on my part to remove touch gestures entirely on IOS.

@Dramex
Copy link
Author

Dramex commented Aug 24, 2018

Hi, i'm using iphone x
yes it should be enabled, i actully was doing the sidebar stuff via just CSS, then when i saw this repo i liked the sliding from right to left so much. then i try it didn't work. sadly i have no difference than before :(

@Dramex
Copy link
Author

Dramex commented Aug 24, 2018

even the sliding from left to right should work in middle of the screen, "swipe-to-go-back" feature works only in the edges so it will not cause any problem to the sidebar if its in middle of the screen, like (Discord app)

@markusenglund
Copy link
Collaborator

Ok, I agree, enabling sliding from the middle of the screen when sidebar is opened seems better. It might take a while before I can actually implement that change though, since I'll be busy starting a new job in next few days and also need to get access to an iPhone.

In the meantime you can use the old version of the package by doing npm install react-sidebar@2.

@Dramex
Copy link
Author

Dramex commented Aug 24, 2018

I meant when it closed, there no issues if people slide left to right (in middle of screen) to open it. like Slideout.js ( https://slideout.js.org ) It will be awesome feature. I beg you to do it :(

@Dramex
Copy link
Author

Dramex commented Aug 24, 2018

sliding from the middle of the screen when sidebar is opened works fine with react-sidebar@2
there no need to changes anything here.

@markusenglund
Copy link
Collaborator

I don't follow. If someone wants to open the sidebar with a touch gesture, they have to slide from the edge to the middle right? And that will in turn cause the go-back-in-history behavior on IOS which makes it basically unusable.

@Dramex
Copy link
Author

Dramex commented Aug 24, 2018

@markusenglund Yes, but why from edges to middle? why not just sliding from left to right in middle of the screen (not from edges). it will works fine like (slideout.js), try slideout in your smartphone and u'll understand what i mean

@markusenglund
Copy link
Collaborator

Ok I understand what you mean. Unfortunately I think that would take quite a bit of effort to implement in this library. I simply don't have the time to do it currently so I will not implement it.

@Dramex
Copy link
Author

Dramex commented Aug 25, 2018

@markusenglund your library already make div that above the main content, and already works with the (edges) in version @2, Is it hard to implement that to a nice base you have?

@markusenglund
Copy link
Collaborator

markusenglund commented Aug 25, 2018

Well, you don't really know before you try but I foresee a few potential problems like

  • Triggering a touchmove event every time the user touches the main content could cause bad performance.
  • We might break other side-swiping functionality in the main content like sliders, toggle-switches etc

It's definitely doable but I just don't feel like taking on the challenge right now. If you want, you could try to make your own PR which would be highly appreciated.

@amatissebastien
Copy link

amatissebastien commented Apr 5, 2019

We are using this plugin for a Cordova app, so we won't have the issue of the 'swipe to go back' feature that exists in Safari.

We could use the older version, but is there anything else that might bite us there? The ideal scenario for us would be an option like iosEnableSwipe that we could pass to force it on, knowing the issue in the browser. We could even dynamically set that for our mobile builds vs our browser builds.

Either way, if you could please let me know if the best solution is to use the older version :)

Thanks, Sebastien

UPDATE: I tried the older version, and its for sure a mess just swapping it out. The code looks really straight forward, so I could customize if needed, but would of course rather have it be a real feature.

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

No branches or pull requests

3 participants