From 9f5f7d13402d30039a29f8f33ad4104351de2cd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kry=C5=A1p=C3=ADn?= Date: Tue, 21 Jan 2025 13:59:29 +0100 Subject: [PATCH] Fix(web-react): Add missing presentation role to TabItem and set correct TabLink role #DS-1653 --- .../src/Resources/components/Tabs/TabItem.twig | 2 +- .../src/Resources/components/Tabs/TabLink.twig | 2 +- .../__snapshots__/tabsDefault.twig.snap.html | 12 ++++++------ .../tabsWithCustomSpacing.twig.snap.html | 12 ++++++------ ...WithCustomSpacingForEachBreakpoint.twig.snap.html | 12 ++++++------ 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/packages/web-twig/src/Resources/components/Tabs/TabItem.twig b/packages/web-twig/src/Resources/components/Tabs/TabItem.twig index d89d3dd6fd..0246a226cb 100644 --- a/packages/web-twig/src/Resources/components/Tabs/TabItem.twig +++ b/packages/web-twig/src/Resources/components/Tabs/TabItem.twig @@ -8,6 +8,6 @@ {%- set _styleProps = useStyleProps(props) -%} {%- set _classNames = [ _rootClassName, _styleProps.className ] -%} -
  • +
  • {% block content %}{% endblock %}
  • diff --git a/packages/web-twig/src/Resources/components/Tabs/TabLink.twig b/packages/web-twig/src/Resources/components/Tabs/TabLink.twig index d0188a8969..b2d2188997 100644 --- a/packages/web-twig/src/Resources/components/Tabs/TabLink.twig +++ b/packages/web-twig/src/Resources/components/Tabs/TabLink.twig @@ -12,7 +12,7 @@ {# Attributes #} {%- set _ariaControlsAttr = _targetPaneId ? 'aria-controls="' ~ _targetPaneId | escape('html_attr') ~ '"' : null -%} {%- set _dataTargetAttr = _targetPaneId ? 'data-spirit-target="#' ~ _targetPaneId | escape('html_attr') ~ '"' : null -%} -{%- set _roleAttr = _href ? 'role="tab"' : null -%} +{%- set _roleAttr = _href ? null : 'role="tab"' -%} {%- set _typeAttr = _href ? null : 'type="button"' -%} {# Miscellaneous #} diff --git a/packages/web-twig/src/Resources/components/Tabs/__tests__/__snapshots__/tabsDefault.twig.snap.html b/packages/web-twig/src/Resources/components/Tabs/__tests__/__snapshots__/tabsDefault.twig.snap.html index 9f0c8bfa36..8b742ec605 100644 --- a/packages/web-twig/src/Resources/components/Tabs/__tests__/__snapshots__/tabsDefault.twig.snap.html +++ b/packages/web-twig/src/Resources/components/Tabs/__tests__/__snapshots__/tabsDefault.twig.snap.html @@ -6,16 +6,16 @@ diff --git a/packages/web-twig/src/Resources/components/Tabs/__tests__/__snapshots__/tabsWithCustomSpacing.twig.snap.html b/packages/web-twig/src/Resources/components/Tabs/__tests__/__snapshots__/tabsWithCustomSpacing.twig.snap.html index c3e8633b59..6a4d42a1cb 100644 --- a/packages/web-twig/src/Resources/components/Tabs/__tests__/__snapshots__/tabsWithCustomSpacing.twig.snap.html +++ b/packages/web-twig/src/Resources/components/Tabs/__tests__/__snapshots__/tabsWithCustomSpacing.twig.snap.html @@ -6,16 +6,16 @@ diff --git a/packages/web-twig/src/Resources/components/Tabs/__tests__/__snapshots__/tabsWithCustomSpacingForEachBreakpoint.twig.snap.html b/packages/web-twig/src/Resources/components/Tabs/__tests__/__snapshots__/tabsWithCustomSpacingForEachBreakpoint.twig.snap.html index 09dc1aaa68..7f3f3c9fe8 100644 --- a/packages/web-twig/src/Resources/components/Tabs/__tests__/__snapshots__/tabsWithCustomSpacingForEachBreakpoint.twig.snap.html +++ b/packages/web-twig/src/Resources/components/Tabs/__tests__/__snapshots__/tabsWithCustomSpacingForEachBreakpoint.twig.snap.html @@ -6,16 +6,16 @@