Skip to content

Commit

Permalink
Fixed selection of text containing special characters
Browse files Browse the repository at this point in the history
  • Loading branch information
ziflex committed Apr 23, 2021
1 parent 5119d62 commit 4346d7b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
12 changes: 12 additions & 0 deletions e2e/tests/dynamic/element/clear/clear.fql
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,16 @@ INPUT_CLEAR(input)

T::EMPTY(INNER_TEXT(doc, "#text_output"))

INPUT(input, "test0-test1", 100)

INPUT_CLEAR(input)

T::EMPTY(INNER_TEXT(doc, "#text_output"))

INPUT(input, "test0&test1", 100)

INPUT_CLEAR(input)

T::EMPTY(INNER_TEXT(doc, "#text_output"))

RETURN NONE
12 changes: 12 additions & 0 deletions e2e/tests/dynamic/element/clear/clear_by_selector.fql
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,16 @@ LET output = ELEMENT(doc, "#text_output")

T::EMPTY(output.innerText)

INPUT(form, "#text_input", "test0-test1", 100)

INPUT_CLEAR(form, "#text_input")

T::EMPTY(output.innerText)

INPUT(form, "#text_input", "test0&test1", 100)

INPUT_CLEAR(form, "#text_input")

T::EMPTY(output.innerText)

RETURN NONE
2 changes: 1 addition & 1 deletion pkg/drivers/cdp/input/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ func (m *Manager) ClearBySelector(ctx context.Context, parentNodeID dom.NodeID,

func (m *Manager) ClearByXY(ctx context.Context, points Quad) error {
delay := time.Duration(drivers.DefaultMouseDelay) * time.Millisecond
err := m.mouse.ClickWithCount(ctx, points.X, points.Y, delay, 2)
err := m.mouse.ClickWithCount(ctx, points.X, points.Y, delay, 3)

if err != nil {
return err
Expand Down

0 comments on commit 4346d7b

Please sign in to comment.