File tree Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -261,7 +261,12 @@ module.exports = React.createClass( {
261
261
this . setState ( { isOpen :false } )
262
262
}
263
263
}
264
- }
264
+ /* resolve a double click issue with the modal */
265
+ } else if ( this . props . modal && this . state . isFocused && prevState . isFocused ) {
266
+ if ( ! this . state . isOpen ) {
267
+ this . setState ( { isOpen : true } ) ;
268
+ }
269
+ }
265
270
266
271
267
272
if ( this . props . value !== prevProps . value ) {
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ module.exports = React.createClass({
90
90
this . props . onMoveFocus ( - 1 ) ;
91
91
}
92
92
}
93
- else if ( event . keyCode === KEYS . ENTER ||
93
+ else if ( event . keyCode === KEYS . ENTER ||
94
94
event . keyCode === KEYS . SPACE ) {
95
95
EventUtil . trapEvent ( event ) ;
96
96
if ( this . props . onSelect ) {
@@ -116,7 +116,9 @@ module.exports = React.createClass({
116
116
} ,
117
117
118
118
handleBlur ( e ) {
119
- if ( this . props . onBlur ) {
119
+ if ( this . props . onBlur &&
120
+ this . refs . link . getDOMNode ( ) !== e . target ) {
121
+
120
122
this . props . onBlur ( this . props . index , e . relatedTarget ) ;
121
123
}
122
124
} ,
@@ -130,15 +132,15 @@ module.exports = React.createClass({
130
132
131
133
render ( ) {
132
134
return (
133
- < li
135
+ < li
134
136
135
137
className = { "slds-dropdown__item slds-has-icon slds-has-icon--left slds-theme--" + this . props . theme }
136
138
onMouseDown = { this . handleMouseDown }
137
139
tabIndex = { - 1 } >
138
140
< a id = { 'menu-0-' + this . props . index }
139
141
href = ''
140
142
ref = 'link'
141
- className = 'slds-truncate'
143
+ className = 'slds-truncate'
142
144
onClick = { this . handleClick }
143
145
onMouseDown = { this . handleMouseDown }
144
146
onKeyDown = { this . handleKeyDown }
Original file line number Diff line number Diff line change @@ -16,8 +16,12 @@ const EventUtil = {
16
16
trapEvent ( event ) {
17
17
event . preventDefault ( ) ;
18
18
event . stopPropagation ( ) ;
19
- if ( event . nativeEvent ) {
19
+
20
+ if ( event . nativeEvent && event . nativeEvent . preventDefault ) {
20
21
event . nativeEvent . preventDefault ( ) ;
22
+ }
23
+
24
+ if ( event . nativeEvent && event . nativeEvent . stopPropagation ) {
21
25
event . nativeEvent . stopPropagation ( ) ;
22
26
}
23
27
} ,
@@ -27,12 +31,12 @@ const EventUtil = {
27
31
} ,
28
32
29
33
trapImmediate ( event ) {
30
- if ( event . nativeEvent ) {
34
+ if ( event . nativeEvent && event . nativeEvent . stopImmediatePropagation ) {
31
35
event . nativeEvent . stopImmediatePropagation ( ) ;
32
36
}
33
37
EventUtil . trap ( event ) ;
34
38
}
35
39
36
40
} ;
37
41
38
- module . exports = EventUtil ;
42
+ module . exports = EventUtil ;
You can’t perform that action at this time.
0 commit comments