Skip to content

Commit

Permalink
ignore Element.Input dispatch events error
Browse files Browse the repository at this point in the history
fix #497
  • Loading branch information
ysmood committed Apr 10, 2022
1 parent 04e0520 commit ff1f1c7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
6 changes: 1 addition & 5 deletions element.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 0 additions & 4 deletions element_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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("")
Expand Down

0 comments on commit ff1f1c7

Please sign in to comment.