From 0374b958f298edd6ef997f8b29a9b38db082974b Mon Sep 17 00:00:00 2001 From: zhangjing Date: Tue, 13 Sep 2022 19:22:11 +0800 Subject: [PATCH] =?UTF-8?q?web=E7=BB=84=E4=BB=B6=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: jiangkaixuan --- .../src/main/ets/MainAbility/pages/web.ets | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) 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 b37c0713e..e3714dc50 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":{ -- GitLab