Skip to content

Commit ac2ad82

Browse files
committed
fix close popover on tab issue in DatePicker
1 parent addbebb commit ac2ad82

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

components/SLDSPicklistBase/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ module.exports = React.createClass( {
182182
<SLDSPopover
183183
className='slds-dropdown slds-dropdown--left slds-dropdown--small slds-dropdown--menu'
184184
targetElement={this.refs.date}
185+
closeOnTabKey={true}
185186
onClose={this.handleCancel}>
186187
{this.getPopoverContent()}
187188
</SLDSPopover>:null

components/SLDSPopover.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ module.exports = React.createClass( {
3636

3737
getDefaultProps () {
3838
return {
39-
targetAttachment: "bottom left",
40-
className: "slds-dropdown"
39+
targetAttachment: 'bottom left',
40+
className: 'slds-dropdown',
41+
closeOnTabKey: false
4142
};
4243
},
4344

@@ -73,8 +74,10 @@ module.exports = React.createClass( {
7374

7475
handleKeyDown (event) {
7576
if(event.keyCode === KEYS.TAB){
76-
EventUtil.trap(event);
77-
this.handleClose();
77+
if(this.props.closeOnTabKey){
78+
EventUtil.trap(event);
79+
this.handleClose();
80+
}
7881
}
7982
},
8083

0 commit comments

Comments
 (0)