@@ -800,6 +800,40 @@ public void TestSetTextSelection()
800
800
AddAssert ( "nothing selected" , ( ) => textBox . SelectedText == string . Empty ) ;
801
801
}
802
802
803
+ [ Test ]
804
+ public void TestTextChangedDuringDoubleClickDrag ( )
805
+ {
806
+ InsertableTextBox textBox = null ;
807
+
808
+ AddStep ( "add textbox" , ( ) =>
809
+ {
810
+ textBoxes . Add ( textBox = new InsertableTextBox
811
+ {
812
+ Size = new Vector2 ( 300 , 40 ) ,
813
+ Text = "initial text" ,
814
+ } ) ;
815
+ } ) ;
816
+
817
+ AddStep ( "click on textbox" , ( ) =>
818
+ {
819
+ InputManager . MoveMouseTo ( textBox ) ;
820
+ InputManager . Click ( MouseButton . Left ) ;
821
+ } ) ;
822
+
823
+ AddStep ( "set text" , ( ) => textBox . Text = "aaaaaaaaaaaaaaaaaaaa" ) ;
824
+
825
+ AddStep ( "select word" , ( ) =>
826
+ {
827
+ InputManager . Click ( MouseButton . Left ) ;
828
+ InputManager . PressButton ( MouseButton . Left ) ;
829
+ } ) ;
830
+
831
+ AddStep ( "insert text" , ( ) => textBox . InsertString ( "a" ) ) ;
832
+ AddAssert ( "text overwritten" , ( ) => textBox . Text == "a" ) ;
833
+ AddStep ( "start drag" , ( ) => InputManager . MoveMouseTo ( textBox , new Vector2 ( - 50 , 0 ) ) ) ;
834
+ AddStep ( "end drag" , ( ) => InputManager . ReleaseButton ( MouseButton . Left ) ) ;
835
+ }
836
+
803
837
[ Test ]
804
838
public void TestSelectAll ( )
805
839
{
0 commit comments