Просмотр исходного кода

Add support for autocomplete attribute in input

Oleksandr Naumov 4 лет назад
Родитель
Сommit
c45446ef7d
2 измененных файлов с 2 добавлено и 1 удалено
  1. 1 1
      include/nitro.hrl
  2. 1 0
      src/elements/input/element_input.erl

+ 1 - 1
include/nitro.hrl

@@ -72,7 +72,7 @@
 -record(textarea,       {?ELEMENT_BASE(element_textarea), autofocus=[], cols=[], dirname=[], disabled=[], form=[], maxlength, name, placeholder, readonly=[], required=[], rows=[], wrap=[], value=[]}).
 
 % HTML Form inputs
--record(input,       {?ELEMENT_BASE(element_input), required, autofocus, disabled, form, name, value, type=[], checked=false, placeholder, multiple, min, max, pattern, accept}).
+-record(input,       {?ELEMENT_BASE(element_input), required, autocomplete, autofocus, disabled, form, name, value, type=[], checked=false, placeholder, multiple, min, max, pattern, accept}).
 -record(input_button,       {?ELEMENT_BASE(element_input_button),  autofocus, disabled, form, name, value}).
 -record(checkbox,           {?ELEMENT_BASE(element_checkbox),  autofocus, checked=false, disabled, form, name, required, value}).
 -record(color,           {?ELEMENT_BASE(element_color),  autocomplete, autofocus, disabled, form, list, name, value}).

+ 1 - 0
src/elements/input/element_input.erl

@@ -33,6 +33,7 @@ render_element(Record) ->
       {<<"title">>, Record#input.title},
       {<<"translate">>, case Record#input.contenteditable of "yes" -> "yes"; "no" -> "no"; _ -> [] end},
       % spec
+      {<<"autocomplete">>,Record#input.autocomplete},
       {<<"autofocus">>,Record#input.autofocus},
       {<<"disabled">>, if Record#input.disabled == true -> "disabled"; true -> [] end},
       {<<"name">>,Record#input.name},