make hover popovers less annoying to close
This commit is contained in:
parent
9c9dc2053b
commit
cb135645f9
|
@ -45,6 +45,10 @@ const Popover = {
|
||||||
inject: ['popoversZLayer'], // override popover z layer
|
inject: ['popoversZLayer'], // override popover z layer
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
// lockReEntry is a flag that is set when mouse cursor is leaving the popover's content
|
||||||
|
// so that if mouse goes back into popover it won't be re-shown again to prevent annoyance
|
||||||
|
// with popovers refusing to be hidden when user wants to interact with something in below popover
|
||||||
|
lockReEntry: false,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
styles: {},
|
styles: {},
|
||||||
oldSize: { width: 0, height: 0 },
|
oldSize: { width: 0, height: 0 },
|
||||||
|
@ -202,6 +206,7 @@ const Popover = {
|
||||||
},
|
},
|
||||||
onMouseenter (e) {
|
onMouseenter (e) {
|
||||||
if (this.trigger === 'hover') {
|
if (this.trigger === 'hover') {
|
||||||
|
this.lockReEntry = false
|
||||||
clearTimeout(this.graceTimeout)
|
clearTimeout(this.graceTimeout)
|
||||||
this.graceTimeout = null
|
this.graceTimeout = null
|
||||||
this.showPopover()
|
this.showPopover()
|
||||||
|
@ -213,7 +218,8 @@ const Popover = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onMouseenterContent (e) {
|
onMouseenterContent (e) {
|
||||||
if (this.trigger === 'hover') {
|
if (this.trigger === 'hover' && !this.lockReEntry) {
|
||||||
|
this.lockReEntry = true
|
||||||
clearTimeout(this.graceTimeout)
|
clearTimeout(this.graceTimeout)
|
||||||
this.graceTimeout = null
|
this.graceTimeout = null
|
||||||
this.showPopover()
|
this.showPopover()
|
||||||
|
|
Loading…
Reference in a new issue