Set aria-current on active tab to indicate to screen readers which is selected.

This commit is contained in:
Nolan Darilek 2021-11-22 14:19:53 -06:00
parent 62e00dc447
commit 6d95137d1f

View file

@ -36,6 +36,7 @@ defmodule LiveBeatsWeb.LayoutView do
<.link
redirect_to={profile_path(@current_user)}
class={"text-gray-700 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md #{if @active_tab == :profile, do: "bg-gray-200", else: "hover:bg-gray-50"}"}
aria-current={if @active_tab == :profile, do: "true", else: "false"}
>
<.icon name={:music_note} outlined class="text-gray-400 group-hover:text-gray-500 mr-3 flex-shrink-0 h-6 w-6"/>
My Songs
@ -44,6 +45,7 @@ defmodule LiveBeatsWeb.LayoutView do
<.link
redirect_to={Routes.settings_path(Endpoint, :edit)}
class={"text-gray-700 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md #{if @active_tab == :settings, do: "bg-gray-200", else: "hover:bg-gray-50"}"}
aria-current={if @active_tab == :settings, do: "true", else: "false"}
>
<.icon name={:adjustments} outlined class="text-gray-400 group-hover:text-gray-500 mr-3 flex-shrink-0 h-6 w-6"/>
Settings