diff --git a/core/lib/Drupal/Core/Utility/TableSort.php b/core/lib/Drupal/Core/Utility/TableSort.php
index 0f9ac41bb8b..fcf5a5b37f5 100644
--- a/core/lib/Drupal/Core/Utility/TableSort.php
+++ b/core/lib/Drupal/Core/Utility/TableSort.php
@@ -15,6 +15,7 @@ class TableSort {
 
   const ASC = 'asc';
   const DESC = 'desc';
+  const INACTIVE = 'inactive';
 
   /**
    * Initializes the table sort context.
@@ -59,6 +60,10 @@ public static function header(&$cell_content, array &$cell_attributes, array $he
     // Special formatting for the currently sorted column header.
     if (isset($cell_attributes['field'])) {
       $title = new TranslatableMarkup('sort by @s', ['@s' => $cell_content]);
+      $tablesort_indicator = [
+        '#theme' => 'tablesort_indicator',
+        '#style' => self::INACTIVE,
+      ];
       if ($cell_content == $context['name']) {
         // aria-sort is a WAI-ARIA property that indicates if items in a table
         // or grid are sorted in ascending or descending order. See
@@ -66,18 +71,14 @@ public static function header(&$cell_content, array &$cell_attributes, array $he
         $cell_attributes['aria-sort'] = ($context['sort'] == self::ASC) ? 'ascending' : 'descending';
         $context['sort'] = (($context['sort'] == self::ASC) ? self::DESC : self::ASC);
         $cell_attributes['class'][] = 'is-active';
-        $tablesort_indicator = [
-          '#theme' => 'tablesort_indicator',
-          '#style' => $context['sort'],
-        ];
-        $image = \Drupal::service('renderer')->render($tablesort_indicator);
+        $tablesort_indicator['#style'] = $context['sort'];
       }
       else {
         // If the user clicks a different header, we want to sort ascending
         // initially.
         $context['sort'] = self::ASC;
-        $image = '';
       }
+      $image = \Drupal::service('renderer')->render($tablesort_indicator);
       $cell_content = Link::createFromRoute(new FormattableMarkup('@cell_content@image', ['@cell_content' => $cell_content, '@image' => $image]), '<current>', [], [
         'attributes' => ['title' => $title],
         'query' => array_merge($context['query'], [
diff --git a/core/modules/system/templates/tablesort-indicator.html.twig b/core/modules/system/templates/tablesort-indicator.html.twig
index bc378133caf..c5c41f13279 100644
--- a/core/modules/system/templates/tablesort-indicator.html.twig
+++ b/core/modules/system/templates/tablesort-indicator.html.twig
@@ -4,7 +4,8 @@
  * Default theme implementation for displaying a tablesort indicator.
  *
  * Available variables:
- * - style: Either 'asc' or 'desc', indicating the sorting direction.
+ * - style: Either 'asc' or 'desc' indicating the active sorting direction, or
+ *   'inactive' for an inactive sort link.
  *
  * @ingroup themeable
  */
@@ -15,6 +16,7 @@
     'tablesort--' ~ style,
   ]
 %}
+{% if style in ['asc', 'desc'] %}
 <span{{ attributes.addClass(classes) }}>
   <span class="visually-hidden">
     {% if style == 'asc' -%}
@@ -24,3 +26,4 @@
     {% endif %}
   </span>
 </span>
+{% endif %}
diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc
index 0fe8bd74547..383b7268eab 100644
--- a/core/modules/views/views.theme.inc
+++ b/core/modules/views/views.theme.inc
@@ -439,7 +439,7 @@ function template_preprocess_views_view_table(&$variables) {
   $columns = $handler->sanitizeColumns($options['columns'], $fields);
 
   $active = !empty($handler->active) ? $handler->active : '';
-  $order = !empty($handler->order) ? $handler->order : 'asc';
+  $order = !empty($handler->order) ? $handler->order : TableSort::ASC;
 
   // A boolean variable which stores whether the table has a responsive class.
   $responsive = FALSE;
@@ -472,20 +472,17 @@ function template_preprocess_views_view_table(&$variables) {
         $variables['header'][$field]['content'] = $label;
       }
       else {
-        $initial = !empty($options['info'][$field]['default_sort_order']) ? $options['info'][$field]['default_sort_order'] : 'asc';
+        $initial = !empty($options['info'][$field]['default_sort_order']) ? $options['info'][$field]['default_sort_order'] : TableSort::ASC;
 
         if ($active == $field) {
-          $initial = ($order == 'asc') ? 'desc' : 'asc';
+          $initial = ($order == TableSort::ASC) ? TableSort::DESC : TableSort::ASC;
         }
 
         $title = t('sort by @s', ['@s' => $label]);
-        if ($active == $field) {
-          $variables['header'][$field]['sort_indicator'] = [
-            '#theme' => 'tablesort_indicator',
-            '#style' => $initial,
-          ];
-        }
-
+        $variables['header'][$field]['sort_indicator'] = [
+          '#theme' => 'tablesort_indicator',
+          '#style' => ($active == $field) ? $initial : TableSort::INACTIVE,
+        ];
         $query['order'] = $field;
         $query['sort'] = $initial;
         $link_options = [
diff --git a/core/themes/stable/templates/admin/tablesort-indicator.html.twig b/core/themes/stable/templates/admin/tablesort-indicator.html.twig
index 135a76c2c44..d2020afc064 100644
--- a/core/themes/stable/templates/admin/tablesort-indicator.html.twig
+++ b/core/themes/stable/templates/admin/tablesort-indicator.html.twig
@@ -4,7 +4,8 @@
  * Theme override for displaying a tablesort indicator.
  *
  * Available variables:
- * - style: Either 'asc' or 'desc', indicating the sorting direction.
+ * - style: Either 'asc' or 'desc' indicating the active sorting direction, or
+ *   'inactive' for an inactive sort link.
  */
 #}
 {%
@@ -13,6 +14,7 @@
     'tablesort--' ~ style,
   ]
 %}
+{% if style in ['asc', 'desc'] %}
 <span{{ attributes.addClass(classes) }}>
   <span class="visually-hidden">
     {% if style == 'asc' -%}
@@ -22,3 +24,4 @@
     {% endif %}
   </span>
 </span>
+{% endif %}
