This repository was archived by the owner on Jan 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -400,7 +400,8 @@ export class MDCMenuSurfaceFoundation extends MDCFoundation<MDCMenuSurfaceAdapte
400400
401401 const isRtl = this . adapter . isRtl ( ) ;
402402 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 ) ;
404405
405406 // Whether surface attached to right side of anchor element.
406407 let isAnchoredToRight = false ;
Original file line number Diff line number Diff line change @@ -842,6 +842,17 @@ describe('MDCMenuSurfaceFoundation', () => {
842842 . toHaveBeenCalledWith ( { right : 0 , top : 0 } ) ;
843843 } ) ;
844844
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+
845856 testFoundation (
846857 '#open Surface is positioned from left side in LTR when corner is flipped horizontally and space is not available on the left side.' ,
847858 ( { foundation, mockAdapter} ) => {
You can’t perform that action at this time.
0 commit comments