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 {
4242 type : Number ,
4343 default : 10
4444 } ,
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+ } ,
4561 tag : {
4662 type : String ,
4763 default : 'ul'
@@ -272,8 +288,19 @@ export default {
272288 } ,
273289
274290 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 ;
277304
278305 if ( top > largestHeight ) {
279306 top = largestHeight ;
You can’t perform that action at this time.
0 commit comments