File tree Expand file tree Collapse file tree 3 files changed +19
-12
lines changed Expand file tree Collapse file tree 3 files changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -119,16 +119,23 @@ export default defineComponent({
119
119
const popper = ref < PopperExposed > ( )
120
120
const popperEl = computed ( ( ) => popper . value ?. wrapper )
121
121
const arrow = ref < HTMLElement > ( )
122
- const shift = computed < { mainAxis ? : boolean , crossAxis ? : boolean } > ( ( ) => {
122
+ const shift = computed < { mainAxis : boolean , crossAxis : boolean } > ( ( ) => {
123
123
if ( ! props . shift ) {
124
- return { mainAxis : false }
124
+ return { mainAxis : false , crossAxis : false }
125
125
}
126
126
127
127
if ( props . shift === true || props . shift === 'both' ) {
128
- return { crossAxis : true }
128
+ return { mainAxis : true , crossAxis : true }
129
129
}
130
130
131
- return props . shift === 'horizontal' ? { mainAxis : false , crossAxis : true } : { }
131
+ const side = placement . value . split ( '-' ) [ 0 ]
132
+
133
+ return props . shift === ( side === 'top' || side === 'bottom' ? 'vertical' : 'horizontal' )
134
+ ? { mainAxis : false , crossAxis : true }
135
+ : {
136
+ mainAxis : true ,
137
+ crossAxis : false ,
138
+ }
132
139
} )
133
140
const { transferTo, updatePopper } = usePopper ( {
134
141
placement,
Original file line number Diff line number Diff line change @@ -107,16 +107,16 @@ type TooltipShift = 'horizontal' | 'vertical' | 'both'
107
107
108
108
type TooltipVirtual =
109
109
| {
110
- getBoundingClientRect: () => DOMRect
110
+ getBoundingClientRect: () => DOMRect ,
111
111
}
112
112
| {
113
113
$el: {
114
- getBoundingClientRect: () => DOMRect
115
- }
114
+ getBoundingClientRect: () => DOMRect ,
115
+ },
116
116
}
117
117
| {
118
118
x: number ,
119
- y: number
119
+ y: number ,
120
120
}
121
121
` ` `
122
122
Original file line number Diff line number Diff line change @@ -107,16 +107,16 @@ type TooltipShift = 'horizontal' | 'vertical' | 'both'
107
107
108
108
type TooltipVirtual =
109
109
| {
110
- getBoundingClientRect: () => DOMRect
110
+ getBoundingClientRect: () => DOMRect ,
111
111
}
112
112
| {
113
113
$el: {
114
- getBoundingClientRect: () => DOMRect
115
- }
114
+ getBoundingClientRect: () => DOMRect ,
115
+ },
116
116
}
117
117
| {
118
118
x: number ,
119
- y: number
119
+ y: number ,
120
120
}
121
121
` ` `
122
122
You can’t perform that action at this time.
0 commit comments