diff --git a/.scss-lint.yml b/.scss-lint.yml index b67166b4bec..dd6d398cfe4 100644 --- a/.scss-lint.yml +++ b/.scss-lint.yml @@ -1,7 +1,7 @@ exclude: - 'app/assets/stylesheets/reset.scss' - 'app/assets/stylesheets/direct_uploads.scss' - - 'app/assets/stylesheets/dsfr.scss' + - 'app/assets/stylesheets/dsfr_override.scss' linters: BangFormat: diff --git a/app/assets/stylesheets/dsfr.scss b/app/assets/stylesheets/dsfr.scss index 36e0eb03bbb..ab27cfff055 100644 --- a/app/assets/stylesheets/dsfr.scss +++ b/app/assets/stylesheets/dsfr.scss @@ -33,12 +33,9 @@ trix-editor.fr-input { width: 100%; } } - .fr-autocomplete{ - // override dsfr chevron down which is - // --data-uri-svg: url("data:image/svg+xml;charset=utf-8,"); - // use a magnifier instead - --data-uri-svg: url("data:image/svg+xml;charset=utf-8,"); - background-image: var(--data-uri-svg); + + .fr-autocomplete { + background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z'%3E%3C/path%3E%3C/svg%3E"); } } diff --git a/app/components/dsfr/combobox_component.rb b/app/components/dsfr/combobox_component.rb index 8a345cee538..d720875f17a 100644 --- a/app/components/dsfr/combobox_component.rb +++ b/app/components/dsfr/combobox_component.rb @@ -28,10 +28,6 @@ def html_input_options }.compact end - def hidden_html_options - @hidden_html_options || {} - end - def input_id @input_html_options[:id] end diff --git a/app/components/dsfr/combobox_component/combobox_component.html.haml b/app/components/dsfr/combobox_component/combobox_component.html.haml index a0440db911e..86dfdc7ceac 100644 --- a/app/components/dsfr/combobox_component/combobox_component.html.haml +++ b/app/components/dsfr/combobox_component/combobox_component.html.haml @@ -2,9 +2,9 @@ .fr-ds-combobox-input %input{ value: selected_option_label_input_value, **html_input_options } - if form - = form.hidden_field name, value: selected_option_value_input_value, form: form_id, **hidden_html_options + = form.hidden_field name, value: selected_option_value_input_value, form: form_id, **@hidden_html_options - else - %input{ type: 'hidden', name: name, value: selected_option_value_input_value, form: form_id, **hidden_html_options } + %input{ type: 'hidden', name: name, value: selected_option_value_input_value, form: form_id, **@hidden_html_options } .fr-menu %ul.fr-menu__list.hidden{ role: 'listbox', hidden: true, id: list_id, data: { turbo_force: :browser, options: options_json, url:, hints: hints_json }.compact } .sr-only{ aria: { live: 'polite', atomic: 'true' }, data: { turbo_force: :browser } } diff --git a/app/javascript/controllers/autosubmit_controller.ts b/app/javascript/controllers/autosubmit_controller.ts index fd037864bf2..156d54afa12 100644 --- a/app/javascript/controllers/autosubmit_controller.ts +++ b/app/javascript/controllers/autosubmit_controller.ts @@ -12,6 +12,7 @@ export class AutosubmitController extends ApplicationController { declare readonly submitterTarget: HTMLButtonElement | HTMLInputElement; declare readonly hasSubmitterTarget: boolean; declare readonly inputTarget: HTMLInputElement; + declare readonly hasInputTarget: boolean; #dateTimeChangedInputs = new WeakSet();