amelioration(combobox): permet de passer des options au input[type=hidden], utilise cette option pour autosubmit uniquement un input [dans notre cas, ne soumet pas a l'input du combobox, mais a l'input hidden une fois le combobox selectionné]

This commit is contained in:
Martin 2023-12-11 17:30:06 +01:00 committed by mfo
parent 7ba13507ff
commit d27e4fc693
5 changed files with 26 additions and 14 deletions

View file

@ -103,10 +103,10 @@ class Dsfr::ComboboxComponentPreview < ViewComponent::Preview
]
def simple_select_with_options
render Dsfr::ComboboxComponent.new(name: :value, options: OPTIONS, selected: OPTIONS.sample, id: 'simple-select', class: 'width-33')
render Dsfr::ComboboxComponent.new(options: OPTIONS, selected: OPTIONS.sample, input_html_options: { name: :value, id: 'simple-select', class: 'width-33' })
end
def simple_select_with_options_and_allows_custom_value
render Dsfr::ComboboxComponent.new(name: :value, options: OPTIONS, selected: OPTIONS.sample, id: 'simple-select', class: 'width-33', allows_custom_value: true)
render Dsfr::ComboboxComponent.new(options: OPTIONS, selected: OPTIONS.sample, allows_custom_value: true, input_html_options: { id: 'simple-select', class: 'width-33', name: :value })
end
end