-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from cwbutler/master
Added ability to stop event propagation from onOpen and onClose props.
- Loading branch information
Showing
3 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react'; | ||
import {Centred} from 'story-router'; | ||
|
||
import Popup from '../../src'; | ||
|
||
const PopupHandleEventProps = {}; | ||
|
||
const PopupHandleEvent = props => ( | ||
<div onClick={() => console.log("I don't want to be called")}> | ||
<Popup | ||
{...props} | ||
trigger={<button>Button Trigger</button>} | ||
onOpen={e => e.stopPropagation()} | ||
onClose={e => e.stopPropagation()}> | ||
<p> | ||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nemo | ||
voluptas s lore Lorem ipsum dolor sit amet consectetur adipisicing | ||
elit. Nemo voluptas s loreLorem ipsum dolor sit amet consectetur | ||
adipisicing elit. Nemo voluptas s loreLorem ipsum dolor sit amet | ||
consectetur adipisicing elit. Nemo voluptas s lore | ||
</p> | ||
</Popup> | ||
</div> | ||
); | ||
|
||
const PopupFuncStory = { | ||
name: 'Popup Event Handling w/ onOpen & onClose', | ||
component: Centred(PopupHandleEvent), | ||
props: PopupHandleEventProps, | ||
}; | ||
|
||
export default PopupFuncStory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters