@@ -3,6 +3,20 @@ var React = require( "react" );
3
3
var Popover = React . createClass ( {
4
4
displayName : "Popover" ,
5
5
6
+ propTypes : {
7
+ attachment : React . PropTypes . string ,
8
+ targetAttachment : React . PropTypes . string ,
9
+ targetOffset : React . PropTypes . string
10
+ } ,
11
+
12
+ getDefaultProps : function ( ) {
13
+ return {
14
+ attachment : "top left" ,
15
+ targetAttachment : "bottom left" ,
16
+ targetOffset : "10px 0"
17
+ } ;
18
+ } ,
19
+
6
20
componentWillMount : function ( ) {
7
21
var popoverContainer = document . createElement ( "span" ) ;
8
22
popoverContainer . className = "datepicker__container" ;
@@ -32,10 +46,10 @@ var Popover = React.createClass( {
32
46
_tetherOptions : function ( ) {
33
47
return {
34
48
element : this . _popoverElement ,
35
- target : this . getDOMNode ( ) . parentElement ,
36
- attachment : "top left" ,
37
- targetAttachment : "bottom left" ,
38
- targetOffset : "10px 0" ,
49
+ target : this . getDOMNode ( ) . parentElement . querySelector ( "input" ) ,
50
+ attachment : this . props . attachment ,
51
+ targetAttachment : this . props . targetAttachment ,
52
+ targetOffset : this . props . targetOffset ,
39
53
optimizations : {
40
54
moveElement : false // always moves to <body> anyway!
41
55
} ,
0 commit comments