From ff1f1c74bf1a16456edac2ca1f3af232540a57a0 Mon Sep 17 00:00:00 2001 From: Yad Smood Date: Sun, 10 Apr 2022 19:37:24 +0800 Subject: [PATCH] ignore Element.Input dispatch events error fix #497 --- element.go | 6 +----- element_test.go | 4 ---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/element.go b/element.go index 6610cc97..aff10b6e 100644 --- a/element.go +++ b/element.go @@ -267,11 +267,7 @@ func (el *Element) Input(text string) error { } err = el.page.Keyboard.InsertText(text) - if err != nil { - return err - } - - _, err = el.Evaluate(evalHelper(js.InputEvent).ByUser()) + _, _ = el.Evaluate(evalHelper(js.InputEvent).ByUser()) return err } diff --git a/element_test.go b/element_test.go index cecf2a7b..6e6bf03c 100644 --- a/element_test.go +++ b/element_test.go @@ -369,10 +369,6 @@ func TestInput(t *testing.T) { g.mc.stubErr(6, proto.RuntimeCallFunctionOn{}) el.MustInput("") }) - g.Panic(func() { - g.mc.stubErr(7, proto.RuntimeCallFunctionOn{}) - el.MustInput("") - }) g.Panic(func() { g.mc.stubErr(1, proto.InputInsertText{}) el.MustInput("")