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

Extends react-click-outside to also work with other events like mousedown #26

Closed
wants to merge 9 commits into from

Conversation

CaptEmulation
Copy link

We had a desire to be able to dismiss components on a mousedown rather than a click event. This PR lets users choose to listen for other "mouse like" events targeting outside the component. Full backwards compatibility is retained with existing code.

In addition as part of doing a private scoped release I took it upon myself to remove the dist/index.js file from the repo and added a prepublishOnly npm script which will automatically build this file when publishing so that it is not necessary to commit to repo. Let me know if you'd like me to revert this portion of the PR as I know it is a side issue.

@kentor
Copy link
Owner

kentor commented Sep 13, 2017

curious why you needed this?

@CaptEmulation
Copy link
Author

curious why you needed this?

We wanted the library to work exactly like it did but to trigger on mousedown instead of click so that we could dismiss when user presses mouse button instead of when they release mouse button.

@kentor
Copy link
Owner

kentor commented Sep 15, 2017

yes i know that is what you want, but why do you want to allow dismissal on mouse press instead of release? is there a technical reason or...?

@CaptEmulation
Copy link
Author

It's a very uninteresting tale. Some people went into a room and came out with a bunch of development tickets and I picked up this one. I honestly don't have any strong feelings on the why or why not. I published this as @captemulation/react-click-outside and we are using that. I try to contribute back to OSS when I can but my feelings won't be hurt if you don't want these changes. ☮️

@kentor
Copy link
Owner

kentor commented Sep 18, 2017

I see. Interesting nonetheless. Well until there is more need for this I will close this for now.

@kentor kentor closed this Sep 18, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants