diff --git a/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets b/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets index b37c0713e531cff58b22df5439b5834f5670856a..e3714dc505b438565fc4b453e6b656113a945b4c 100644 --- a/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets +++ b/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets @@ -207,6 +207,28 @@ struct Index { this.geoShow=false } }) + .onBlur(()=>{ + console.info("onBlur==>") + this.controller.requestFocus() + }) + TextInput({placeholder:"inputs your words"}) + .key('textInput') + .type(InputType.Normal) + .placeholderColor(Color.Blue) + .placeholderFont({size:20,weight:FontWeight.Normal,family:"sans-serif",style:FontStyle.Normal}) + .enterKeyType(EnterKeyType.Next) + .caretColor(Color.Green) + .height(60) + .fontSize(30) + .fontWeight(FontWeight.Bold) + .fontFamily("cursive") + .fontStyle(FontStyle.Italic) + .fontColor(Color.Red) + .maxLength(20) + .border({width:1,color:0x317AF7,radius:10,style:BorderStyle.Solid}) + .onClick(()=>{ + console.info("TextInput click") + }) Row(){ Button("web click").key('webcomponent').onClick(async ()=>{ console.info("key==>"+this.str) @@ -301,7 +323,8 @@ struct Index { } case "emitGetRequestFocus":{ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/second.html"}) - this.controller.requestFocus() + await Utils.sleep(2000) + sendEventByKey('textInput',10,'') break; } case "emitAccessBackward":{