@@ -47,13 +47,6 @@ defmodule Backpex.HTML.Form do
4747 slot :inner_block
4848
4949 def input ( % { field: % Phoenix.HTML.FormField { } = field } = assigns ) do
50- assigns =
51- if Map . has_key? ( assigns . rest , :disabled ) do
52- assigns
53- else
54- put_in ( assigns , [ :rest , :disabled ] , Map . get ( assigns . rest , :readonly ) || false )
55- end
56-
5750 assigns
5851 |> prepare_field_assigns ( field , assigns . translate_error_fun )
5952 |> assign_new ( :name , fn -> if assigns . multiple , do: field . name <> "[]" , else: field . name end )
@@ -212,13 +205,6 @@ defmodule Backpex.HTML.Form do
212205 multiple pattern placeholder readonly required rows size step)
213206
214207 def currency_input ( % { field: % Phoenix.HTML.FormField { } = field } = assigns ) do
215- assigns =
216- if Map . has_key? ( assigns . rest , :disabled ) do
217- assigns
218- else
219- put_in ( assigns , [ :rest , :disabled ] , Map . get ( assigns . rest , :readonly ) || false )
220- end
221-
222208 assigns
223209 |> prepare_field_assigns ( field , assigns . translate_error_fun )
224210 |> assign_new ( :name , fn -> field . name end )
@@ -300,7 +286,7 @@ defmodule Backpex.HTML.Form do
300286 @ doc type: :component
301287
302288 attr :prompt , :string , required: true , doc: "string that will be shown when no option is selected"
303- attr :readonly , :boolean , default: false
289+ attr :readonly , :boolean , default: false , doc: "whether the dropdown is readonly"
304290 attr :help_text , :string , default: nil , doc: "help text to be displayed below input"
305291 attr :not_found_text , :string , required: true , doc: "string that will be shown when there are no options"
306292 attr :options , :list , required: true , doc: "a list of options for the select"
0 commit comments