File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
src/components/sub-components/mgt-flyout Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1414 <!-- <script src="./dist/bundle/mgt-loader.js"></script> -->
1515
1616 < script type ="module " src ="dist/es6/index.js "> </ script >
17- < script type ="module " src ="dist/es6/components/sub-components/mgt-flyout/mgt-flyout.js "> </ script >
1817 < script type ="module " src ="./dist/es6/mock/mgt-mock-provider.js "> </ script >
1918 </ head >
2019
3332 <!-- <mgt-mock-provider></mgt-mock-provider> -->
3433
3534 < mgt-login > </ mgt-login >
36- < mgt-person person-query ="me " person-card ="click "> </ mgt-person >
37- < mgt-tasks > </ mgt-tasks >
35+ < mgt-person person-query ="me " show-name show-email person-card ="hover "> </ mgt-person >
36+ < mgt-people-picker > </ mgt-people-picker >
37+ < mgt-tasks data-source ="todo "> </ mgt-tasks >
38+ < mgt-agenda group-by-day > </ mgt-agenda >
39+ < mgt-people > </ mgt-people >
3840 </ body >
3941</ html >
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ export class MgtFlyout extends LitElement {
109109 if ( flyout && anchor ) {
110110 let left : number ;
111111 let bottom : number ;
112+ let top : number ;
112113
113114 if ( this . isOpen ) {
114115 const flyoutRect = flyout . getBoundingClientRect ( ) ;
@@ -152,13 +153,16 @@ export class MgtFlyout extends LitElement {
152153 }
153154 }
154155
155- if ( windowHeight < flyoutBottom ) {
156+ if ( flyoutRect . height > windowHeight || ( windowHeight < flyoutBottom && anchorRect . top < flyoutRect . height ) ) {
157+ top = - flyoutTop + anchorRect . height ;
158+ } else if ( windowHeight < flyoutBottom ) {
156159 bottom = anchorRect . height ;
157160 }
158161 }
159162
160163 flyout . style . left = typeof left !== 'undefined' ? `${ left } px` : '' ;
161164 flyout . style . bottom = typeof bottom !== 'undefined' ? `${ bottom } px` : '' ;
165+ flyout . style . top = typeof top !== 'undefined' ? `${ top } px` : '' ;
162166 }
163167 }
164168}
You can’t perform that action at this time.
0 commit comments