diff --git a/core/modules/views/views.api.php b/core/modules/views/views.api.php
index 6e9dae8..0183de4 100644
--- a/core/modules/views/views.api.php
+++ b/core/modules/views/views.api.php
@@ -612,8 +612,8 @@ function hook_views_ajax_data_alter(array &$commands, ViewExecutable $view) {
   // Replace Views' method for scrolling to the top of the element with your
   // custom scrolling method.
   foreach ($commands as &$command) {
-    if ($command['method'] == 'viewsScrollTop') {
-      $command['method'] .= 'myScrollTop';
+    if ($command['command'] == 'viewsScrollTop') {
+      $command['command'] .= 'myScrollTop';
     }
   }
 }
