This repository was archived by the owner on Jan 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -400,7 +400,8 @@ export class MDCMenuSurfaceFoundation extends MDCFoundation<MDCMenuSurfaceAdapte
400
400
401
401
const isRtl = this . adapter . isRtl ( ) ;
402
402
const isFlipRtl = this . hasBit ( this . anchorCorner , CornerBit . FLIP_RTL ) ;
403
- const hasRightBit = this . hasBit ( this . anchorCorner , CornerBit . RIGHT ) ;
403
+ const hasRightBit = this . hasBit ( this . anchorCorner , CornerBit . RIGHT ) ||
404
+ this . hasBit ( corner , CornerBit . RIGHT ) ;
404
405
405
406
// Whether surface attached to right side of anchor element.
406
407
let isAnchoredToRight = false ;
Original file line number Diff line number Diff line change @@ -842,6 +842,17 @@ describe('MDCMenuSurfaceFoundation', () => {
842
842
. toHaveBeenCalledWith ( { right : 0 , top : 0 } ) ;
843
843
} ) ;
844
844
845
+ testFoundation (
846
+ '#open Surface is positioned from right side in LTR when corner is flipped horizontally and anchor is wider than menu.' ,
847
+ ( { foundation, mockAdapter} ) => {
848
+ initAnchorLayout ( mockAdapter , wideTopLeft ) ;
849
+ foundation . flipCornerHorizontally ( ) ;
850
+ foundation . open ( ) ;
851
+ jasmine . clock ( ) . tick ( 1 ) ; // Run to frame.
852
+ expect ( mockAdapter . setTransformOrigin ) . toHaveBeenCalledWith ( 'center top' ) ;
853
+ expect ( mockAdapter . setPosition ) . toHaveBeenCalledWith ( { right : 0 , top : 0 } ) ;
854
+ } ) ;
855
+
845
856
testFoundation (
846
857
'#open Surface is positioned from left side in LTR when corner is flipped horizontally and space is not available on the left side.' ,
847
858
( { foundation, mockAdapter} ) => {
You can’t perform that action at this time.
0 commit comments