@@ -694,6 +694,66 @@ describe("Dialog general interaction", () => {
694
694
} ) ;
695
695
} ) ;
696
696
697
+ it ( "dialog remains anchored after resizing in RTL mode" , ( ) => {
698
+ cy . mount (
699
+ < >
700
+ < div dir = "rtl" >
701
+ < Dialog id = "rtl-min-width-dialog" resizable >
702
+ < div id = "header-slot" slot = "header" > Header</ div >
703
+ < div > Content Content Content Content Content Content Content Content Content Content Content Content</ div >
704
+ < Button id = "resizable-close" > Close</ Button >
705
+ </ Dialog >
706
+ </ div >
707
+ </ >
708
+ ) ;
709
+
710
+ // Open dialog
711
+ cy . get ( "#rtl-min-width-dialog" ) . invoke ( "attr" , "open" , true ) ;
712
+ cy . get < Dialog > ( "#rtl-min-width-dialog" ) . ui5DialogOpened ( ) ;
713
+
714
+ // Capture initial dimensions and position
715
+ cy . get ( "#rtl-min-width-dialog" ) . then ( dialog => {
716
+ const initialLeft = parseInt ( dialog . css ( "left" ) ) ;
717
+ const initialWidth = parseInt ( dialog . css ( "width" ) ) ;
718
+ const initialRightEdge = initialLeft + initialWidth ;
719
+
720
+ // First resize to reach minimum width
721
+ cy . get ( "#rtl-min-width-dialog" )
722
+ . shadow ( )
723
+ . find ( ".ui5-popup-resize-handle" )
724
+ . realMouseDown ( )
725
+ . realMouseMove ( 800 , 0 ) // Large movement to ensure we hit min width
726
+ . realMouseUp ( ) ;
727
+
728
+ cy . get ( "#rtl-min-width-dialog" ) . then ( dialogAtMinWidth => {
729
+ const leftAtMinWidth = parseInt ( dialogAtMinWidth . css ( "left" ) ) ;
730
+ const widthAtMinWidth = parseInt ( dialogAtMinWidth . css ( "width" ) ) ;
731
+ const rightEdgeAtMinWidth = leftAtMinWidth + widthAtMinWidth ;
732
+
733
+ expect ( widthAtMinWidth ) . to . equal ( 320 ) ;
734
+ expect ( rightEdgeAtMinWidth ) . to . equal ( initialRightEdge ) ;
735
+
736
+ cy . get ( "#rtl-min-width-dialog" )
737
+ . shadow ( )
738
+ . find ( ".ui5-popup-resize-handle" )
739
+ . realMouseDown ( )
740
+ . realMouseMove ( 150 , 0 ) // Additional rightward movement beyond min width
741
+ . realMouseUp ( ) ;
742
+
743
+ cy . get ( "#rtl-min-width-dialog" ) . then ( dialogAfterExtraResize => {
744
+ const finalLeft = parseInt ( dialogAfterExtraResize . css ( "left" ) ) ;
745
+ const finalWidth = parseInt ( dialogAfterExtraResize . css ( "width" ) ) ;
746
+ const finalRightEdge = finalLeft + finalWidth ;
747
+
748
+ expect ( finalLeft ) . to . equal ( leftAtMinWidth , "Dialog left position should not change when at min width" ) ;
749
+ expect ( finalWidth ) . to . equal ( widthAtMinWidth , "Dialog width should remain at min width" ) ;
750
+ expect ( finalRightEdge ) . to . equal ( rightEdgeAtMinWidth , "Dialog right edge should remain fixed" ) ;
751
+ expect ( finalRightEdge ) . to . equal ( initialRightEdge , "Dialog right edge should remain fixed from initial position" ) ;
752
+ } ) ;
753
+ } ) ;
754
+ } ) ;
755
+ } ) ;
756
+
697
757
it ( "resizable - keyboard support" , ( ) => {
698
758
cy . mount (
699
759
< >
0 commit comments