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

Add prop disableSwipe to LeftNav #1258

Closed
wants to merge 5 commits into from
Closed

Conversation

revskill10
Copy link

When setting props disableSwipe to true, the swipe behavior only affects when the LeftNav is opening, and we cannot open LeftNav by swiping.

@@ -39,6 +40,7 @@ let LeftNav = React.createClass({
getDefaultProps() {
return {
docked: true,
disableSwipe: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

false

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the default behavior is disabled. Could you explain more here ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are introducing a breaking changing by changing the default behavior (of the code).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed! Thank you.

@pomerantsev
Copy link
Contributor

@checkraiser, I think that issue #1222 that you've probably tried to address was only about disabling opening the nav using a swipe, but not both opening and closing it. But now if you set disableSwipe: true, swipe behavior is disabled completely.

@revskill10
Copy link
Author

@pomerantsev Please check the code to test it. I think it's enough for your use case.

@maoziliang
Copy link
Contributor

Perhaps the prop name should be disableSwipeOut? Because if I see the disableSwipe, I think both open and close will be disabled. And it had been my real thought before @pomerantsev commented.
@hai-cea

@@ -39,6 +40,7 @@ let LeftNav = React.createClass({
getDefaultProps() {
return {
docked: true,
disableSwipe: false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo here - should be disableSwipeOut

@pomerantsev
Copy link
Contributor

@checkraiser: This component's behavior has become even weirder with the latest changes:

  • there's no opening state property, it should probably be open;
  • looks like with this change, the swipe to open feature will be completely disabled - and I'm not sure if that's desired.

Anyway, I went ahead and implemented the fix in #1279 - it is a very simple change, no need for much code here.
@hai-cea: thoughts?

@hai-cea
Copy link
Member

hai-cea commented Jul 29, 2015

@pomerantsev Your PR seems pretty straight forward. I'm assuming it makes this PR unnecessary?
@checkraiser do you agree?

@revskill10
Copy link
Author

@ALL: It's OK. I will close here. Wait for the next PR ! :)

@revskill10 revskill10 closed this Jul 29, 2015
@zannager zannager added the docs Improvements or additions to the documentation label Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants