Skip to content

Commit e0b7de7

Browse files
committed
Update examples to show an example of a custom popover location
1 parent f725cc5 commit e0b7de7

File tree

2 files changed

+754
-588
lines changed

2 files changed

+754
-588
lines changed

example/App.jsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ var exampleComponent = React.createClass({
1212
new_date: null,
1313
bound_date: null,
1414
example5Selected: null,
15-
example6Selected: null
15+
example6Selected: null,
16+
custom_popover_date: moment()
1617
};
1718
},
1819

@@ -52,6 +53,12 @@ var exampleComponent = React.createClass({
5253
});
5354
},
5455

56+
handleCustomPopoverChange: function(date) {
57+
this.setState({
58+
custom_popover_date: date
59+
});
60+
},
61+
5562
render: function() {
5663
return <div>
5764
<DatePicker
@@ -100,6 +107,14 @@ var exampleComponent = React.createClass({
100107
disabled={true}
101108
placeholderText="This is disabled"
102109
/>
110+
<DatePicker
111+
key="example8"
112+
selected={this.state.custom_popover_date}
113+
onChange={this.handleCustomPopoverChange}
114+
popoverAttachment="bottom center"
115+
popoverTargetAttachment="top center"
116+
popoverTargetOffset="0px 0px"
117+
/>
103118
</div>;
104119
}
105120
});

0 commit comments

Comments
 (0)