This repository was archived by the owner on Oct 5, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +29
-2
lines changed Expand file tree Collapse file tree 1 file changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,22 @@ export default {
42
42
type : Number ,
43
43
default : 10
44
44
} ,
45
+ useScrollHeight : {
46
+ type : Boolean ,
47
+ default : false
48
+ } ,
49
+ useScrollWidth : {
50
+ type : Boolean ,
51
+ default : false
52
+ } ,
53
+ heightOffset : {
54
+ type : Number ,
55
+ default : 25
56
+ } ,
57
+ widthOffset : {
58
+ type : Number ,
59
+ default : 25
60
+ } ,
45
61
tag : {
46
62
type : String ,
47
63
default : 'ul'
@@ -272,8 +288,19 @@ export default {
272
288
} ,
273
289
274
290
positionMenu ( top , left , element ) {
275
- const largestHeight = window . innerHeight - element . offsetHeight - 25 ;
276
- const largestWidth = window . innerWidth - element . offsetWidth - 25 ;
291
+ const largestHeight =
292
+ window . innerHeight -
293
+ ( this . $props . useScrollHeight
294
+ ? element . scrollHeight
295
+ : element . offsetHeight ) -
296
+ this . $props . heightOffset ;
297
+
298
+ const largestWidth =
299
+ window . innerWidth -
300
+ ( this . $props . useScrollWidth
301
+ ? element . scrollWidth
302
+ : element . offsetWidth ) -
303
+ this . $props . widthOffset ;
277
304
278
305
if ( top > largestHeight ) {
279
306
top = largestHeight ;
You can’t perform that action at this time.
0 commit comments