From 7fdb30520eb04d1717ee64e9a9ac0a0066aa3e88 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 14 Dec 2021 12:17:40 -0600 Subject: [PATCH] Hide title/artist metadata when empty. From an accessibility perspective, having an empty `

` is confusing. Even though it lacks text, it remains visible to scree readers and is still navigable. I'm not sure whether wrapping the entire `
` in this check breaks the layout, or if the individual elements should have `aria-hidden` set if their values are empty. --- lib/live_beats_web/live/player_live.ex | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/live_beats_web/live/player_live.ex b/lib/live_beats_web/live/player_live.ex index c56438b..6d2e3dc 100644 --- a/lib/live_beats_web/live/player_live.ex +++ b/lib/live_beats_web/live/player_live.ex @@ -15,16 +15,18 @@ defmodule LiveBeatsWeb.PlayerLive do
-
-
+ <%= if @song do %> +
+

- <%= if @song, do: @song.title, else: raw(" ") %> + <%= @song.title %>

- <%= if @song, do: @song.artist, else: raw(" ") %> + <%= @song.artist %>

+
-
+ <% end %> <.progress_bar id="player-progress" />