This commit is contained in:
parent
b86c1afa79
commit
287e4048e2
|
@ -17,6 +17,7 @@ class DatePicker extends Component {
|
|||
locale: locale,
|
||||
dateFormat: locale == 'es' ? 'd-m-Y' : 'Y-m-d',
|
||||
enableTime: false,
|
||||
disableMobile: true,
|
||||
onValueUpdate: () => this.onValueUpdate()
|
||||
};
|
||||
this.userOptions = {};
|
||||
|
|
|
@ -24,9 +24,8 @@ export default class Popover extends Component {
|
|||
|
||||
this.docKeyDownHandler = e => this.onDocKeyDown(e);
|
||||
this.docFocusInHandler = e => this.onDocFocusIn(e);
|
||||
this.bgMouseDownHandler = e => this.onBgMouseDown(e);
|
||||
|
||||
this.element.addEventListener('mousedown',
|
||||
e => this.onBackgroundMouseDown(e));
|
||||
this.element.addEventListener('focusin',
|
||||
e => this.onFocusIn(e));
|
||||
|
||||
|
@ -84,6 +83,7 @@ export default class Popover extends Component {
|
|||
|
||||
this.document.addEventListener('keydown', this.docKeyDownHandler);
|
||||
this.document.addEventListener('focusin', this.docFocusInHandler);
|
||||
this.element.addEventListener('mousedown', this.bgMouseDownHandler);
|
||||
|
||||
this.deregisterCallback = this.$transitions.onStart({}, () => this.hide());
|
||||
this.relocate();
|
||||
|
@ -107,6 +107,7 @@ export default class Popover extends Component {
|
|||
|
||||
this.document.removeEventListener('keydown', this.docKeyDownHandler);
|
||||
this.document.removeEventListener('focusin', this.docFocusInHandler);
|
||||
this.element.removeEventListener('mousedown', this.bgMouseDownHandler);
|
||||
|
||||
if (this.deregisterCallback)
|
||||
this.deregisterCallback();
|
||||
|
@ -173,7 +174,7 @@ export default class Popover extends Component {
|
|||
this.lastMouseEvent = event;
|
||||
}
|
||||
|
||||
onBackgroundMouseDown(event) {
|
||||
onBgMouseDown(event) {
|
||||
if (event != this.lastMouseEvent)
|
||||
this.hide();
|
||||
}
|
||||
|
|
|
@ -95,6 +95,7 @@ vn-app {
|
|||
|
||||
form vn-horizontal {
|
||||
flex-direction: column;
|
||||
align-items: initial;
|
||||
}
|
||||
}
|
||||
vn-main-block {
|
||||
|
|
Loading…
Reference in New Issue