Skip to content

Commit

Permalink
Scroll an element into view using W3C suggested steps
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed May 2, 2017
1 parent 1fd2760 commit 56be183
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public W3CHttpCommandCodec() {

case GET_ELEMENT_LOCATION_ONCE_SCROLLED_INTO_VIEW:
return toScript(
"var e = arguments[0]; e.scrollIntoView(); var rect = e.getBoundingClientRect(); return {'x': rect.left, 'y': rect.top};",
"var e = arguments[0]; e.scrollIntoView(behavior: 'instant', block: 'end', inline: 'nearest'); var rect = e.getBoundingClientRect(); return {'x': rect.left, 'y': rect.top};",
asElement(parameters.get("id")));

case GET_PAGE_SOURCE:
Expand Down

0 comments on commit 56be183

Please sign in to comment.