Skip to content

Commit

Permalink
Parameter for scrollIntoView is an Object
Browse files Browse the repository at this point in the history
Because this is a "truthy" value, those browsers that
don't honour the new-fangled parameter passing approch
will treat this as `true`, which is the default value
if there is no argument given.
  • Loading branch information
shs96c committed May 3, 2017
1 parent a8a0034 commit 49f3b97
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(behavior: 'instant', block: 'end', inline: 'nearest'); 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 49f3b97

Please sign in to comment.