File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
tests/app/xml-declaration Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -900,3 +900,15 @@ export function test_hasSourceCodeLocations() {
900900 var labelSource = Source . get ( label ) ;
901901 TKUnit . assertEqual ( labelSource . toString ( ) , "file:///app/" + basePath + "examples/test-page.xml:3:5" ) ;
902902}
903+
904+ export function test_Setting_digits_for_text_Label_is_not_converted_to_number ( ) {
905+ var p = < Page > builder . parse ( '<Page><Label id="testLabel" text="01234"/></Page>' ) ;
906+ var testLabel = < Label > p . getViewById ( "testLabel" ) ;
907+ TKUnit . assertEqual ( testLabel . text , "01234" ) ;
908+ }
909+
910+ export function test_Setting_digits_for_text_Button_is_not_converted_to_number ( ) {
911+ var p = < Page > builder . parse ( '<Page><Button id="testButton" text="01234"/></Page>' ) ;
912+ var testButton = < Button > p . getViewById ( "testButton" ) ;
913+ TKUnit . assertEqual ( testButton . text , "01234" ) ;
914+ }
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ import {Source} from "utils/debug";
2121registerSpecialProperty ( "class" , ( instance : definition . View , propertyValue : string ) => {
2222 instance . className = propertyValue ;
2323} ) ;
24+ registerSpecialProperty ( "text" , ( instance , propertyValue ) => {
25+ instance . set ( "text" , propertyValue ) ;
26+ } ) ;
2427
2528function getEventOrGestureName ( name : string ) : string {
2629 return name . indexOf ( "on" ) === 0 ? name . substr ( 2 , name . length - 2 ) : name ;
You can’t perform that action at this time.
0 commit comments