Skip to content

Commit cda21e5

Browse files
committed
Update missing fields
1 parent 571c239 commit cda21e5

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

lib/backpex/fields/has_many.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ defmodule Backpex.Fields.HasMany do
136136
<div id={@name}>
137137
<Layout.field_container>
138138
<:label align={Backpex.Field.align_label(@field_options, assigns)}>
139-
<Layout.input_label text={@field_options[:label]} />
139+
<Layout.input_label as="span" text={@field_options[:label]} />
140140
</:label>
141141
<div class="dropdown w-full">
142142
<label

lib/backpex/fields/has_many_through.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,11 @@ defmodule Backpex.Fields.HasManyThrough do
238238
<div>
239239
<Layout.field_container>
240240
<:label align={Backpex.Field.align_label(@field_options, assigns, :top)}>
241-
<Layout.input_label text={@field_options[:label]} />
241+
<Layout.input_label id={"has-many-through-label-#{@name}"} as="span" text={@field_options[:label]} />
242242
</:label>
243243
244244
<div :if={@listables != []} class="ring-base-content/10 rounded-box mb-4 overflow-x-auto ring-1">
245-
<table class="table">
245+
<table class="table" aria-labelledby={"has-many-through-label-#{@name}"}>
246246
<thead class="bg-base-200/50 text-base-content uppercase">
247247
<tr>
248248
<th
@@ -535,7 +535,7 @@ defmodule Backpex.Fields.HasManyThrough do
535535
~H"""
536536
<Layout.field_container>
537537
<:label>
538-
<Layout.input_label text={@label} />
538+
<Layout.input_label for={@form[@owner_key]} text={@label} />
539539
</:label>
540540
<BackpexForm.input
541541
type="select"

lib/backpex/fields/inline_crud.ex

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ defmodule Backpex.Fields.InlineCRUD do
129129
<div>
130130
<Layout.field_container>
131131
<:label align={Backpex.Field.align_label(@field_options, assigns, :top)}>
132-
<Layout.input_label text={@field_options[:label]} />
132+
<Layout.input_label id={"inline-crud-label-#{@name}"} as="span" text={@field_options[:label]} />
133133
</:label>
134134
135135
<div class="flex flex-col">
@@ -141,12 +141,15 @@ defmodule Backpex.Fields.InlineCRUD do
141141
:for={{child_field_name, child_field_options} <- @child_fields}
142142
class={child_field_class(child_field_options, assigns)}
143143
>
144-
<p :if={f_nested.index == 0} class="mb-1 text-xs">
145-
{child_field_options.label}
146-
</p>
144+
<span
145+
:if={f_nested.index == 0}
146+
id={"inline-crud-header-label-#{@name}-#{child_field_name}"}
147+
class="mb-1 text-xs"
148+
>
147149
<BackpexForm.input
148150
type={input_type(child_field_options) |> Atom.to_string()}
149151
field={f_nested[child_field_name]}
152+
aria-labelledby={"inline-crud-header-label-#{@name}-#{child_field_name} inline-crud-label-#{@name}"}
150153
translate_error_fun={Backpex.Field.translate_error_fun(child_field_options, assigns)}
151154
phx-debounce={Backpex.Field.debounce(child_field_options, assigns)}
152155
phx-throttle={Backpex.Field.throttle(child_field_options, assigns)}

lib/backpex/fields/multi_select.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ defmodule Backpex.Fields.MultiSelect do
143143
<div id={@name}>
144144
<Layout.field_container>
145145
<:label align={Backpex.Field.align_label(@field_options, assigns)}>
146-
<Layout.input_label text={@field_options[:label]} />
146+
<Layout.input_label as="span" text={@field_options[:label]} />
147147
</:label>
148148
<Form.multi_select
149149
field={@form[@name]}

0 commit comments

Comments
 (0)