diff --git a/core/modules/user/src/Plugin/views/argument_validator/User.php b/core/modules/user/src/Plugin/views/argument_validator/User.php
index e6a15dd..25d23b2 100644
--- a/core/modules/user/src/Plugin/views/argument_validator/User.php
+++ b/core/modules/user/src/Plugin/views/argument_validator/User.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
 use Drupal\views\Plugin\views\argument_validator\Entity;
 
 /**
@@ -52,6 +53,7 @@ protected function defineOptions() {
    */
   public function buildOptionsForm(&$form, &$form_state) {
     parent::buildOptionsForm($form, $form_state);
+    $sanitized_id = ArgumentPluginBase::encodeValidatorId($this->definition['id']);
 
     $form['restrict_roles'] = array(
       '#type' => 'checkbox',
@@ -67,7 +69,7 @@ public function buildOptionsForm(&$form, &$form_state) {
       '#description' => $this->t('If no roles are selected, users from any role will be allowed.'),
       '#states' => array(
         'visible' => array(
-          ':input[name="options[validate][options][user][restrict_roles]"]' => array('checked' => TRUE),
+          ':input[name="options[validate][options][' . $sanitized_id . '][restrict_roles]"]' => array('checked' => TRUE),
         ),
       ),
     );
diff --git a/core/modules/user/src/Tests/Views/ArgumentValidateTest.php b/core/modules/user/src/Tests/Views/ArgumentValidateTest.php
index 3bc83d9..f1e9c0e 100644
--- a/core/modules/user/src/Tests/Views/ArgumentValidateTest.php
+++ b/core/modules/user/src/Tests/Views/ArgumentValidateTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Tests\Views;
 
+use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
 use Drupal\views\Views;
 
 /**
@@ -43,6 +44,11 @@ function testArgumentValidateUserUid() {
     $view->argument['null']->argument_validated = NULL;
     // Fail for a valid numeric, but for a user that doesn't exist
     $this->assertFalse($view->argument['null']->validateArgument(32));
+
+    $form = $form_state = array();
+    $view->argument['null']->buildOptionsForm($form, $form_state);
+    $sanitized_id = ArgumentPluginBase::encodeValidatorId('entity:user');
+    $this->assertTrue($form['validate']['options'][$sanitized_id]['roles']['#states']['visible'][':input[name="options[validate][options][' . $sanitized_id . '][restrict_roles]"]']['checked']);
   }
 
   /**
