diff --git a/app/assets/stylesheets/forms.scss b/app/assets/stylesheets/forms.scss index f54267a73..531b7bc2f 100644 --- a/app/assets/stylesheets/forms.scss +++ b/app/assets/stylesheets/forms.scss @@ -328,19 +328,21 @@ } } - [data-reach-combobox-input] { - width: 100%; - min-width: 50%; - max-width: 100%; min-height: 62px; border-radius: 4px; border: solid 1px $border-grey; padding: $default-padding; - } - [data-reach-combobox-input]:focus { - border-color: $blue-france-500; + &:not([class^='width-']) { + width: 100%; + min-width: 50%; + max-width: 100%; + } + + &:focus { + border-color: $blue-france-500; + } } [data-reach-combobox-token-list] { diff --git a/app/assets/stylesheets/utils.scss b/app/assets/stylesheets/utils.scss index 7b6b685e2..9f0a2399e 100644 --- a/app/assets/stylesheets/utils.scss +++ b/app/assets/stylesheets/utils.scss @@ -73,6 +73,12 @@ // sizing .width-100 { width: 100%; + + @media (max-width: $two-columns-breakpoint) { + &-mobile { + width: 100%; + } + } } .width-33 { diff --git a/app/javascript/components/ComboCommunesSearch.tsx b/app/javascript/components/ComboCommunesSearch.tsx index b8e723ee2..e2ac22731 100644 --- a/app/javascript/components/ComboCommunesSearch.tsx +++ b/app/javascript/components/ComboCommunesSearch.tsx @@ -54,8 +54,12 @@ const [placeholderDepartement, placeholderCommune] = export default function ComboCommunesSearch({ id, + classNameDepartement, ...props -}: ComboSearchProps & { id: string }) { +}: ComboSearchProps & { + id: string; + classNameDepartement?: string; +}) { const group = groupId(id); const [departementValue, setDepartementValue] = useHiddenField( group, @@ -84,6 +88,7 @@ export default function ComboCommunesSearch({ placeholder={placeholderDepartement} addForeignDepartement={false} value={departementValue} + className={classNameDepartement} onChange={(_, result) => { setDepartementValue(result?.nom ?? ''); setCodeDepartement(result?.code ?? ''); diff --git a/app/views/shared/dossiers/editable_champs/_communes.html.haml b/app/views/shared/dossiers/editable_champs/_communes.html.haml index ca33da594..0f718c12e 100644 --- a/app/views/shared/dossiers/editable_champs/_communes.html.haml +++ b/app/views/shared/dossiers/editable_champs/_communes.html.haml @@ -5,4 +5,6 @@ = react_component("ComboCommunesSearch", required: champ.mandatory?, id: champ.input_id, + classNameDepartement: "width-33-desktop width-100-mobile", + className: "width-66-desktop width-100-mobile", describedby: champ.describedby_id) diff --git a/app/views/shared/dossiers/editable_champs/_departements.html.haml b/app/views/shared/dossiers/editable_champs/_departements.html.haml index f91cd543b..cd18950cd 100644 --- a/app/views/shared/dossiers/editable_champs/_departements.html.haml +++ b/app/views/shared/dossiers/editable_champs/_departements.html.haml @@ -3,4 +3,5 @@ = react_component("ComboDepartementsSearch", required: champ.mandatory?, id: champ.input_id, + className: "width-33-desktop width-100-mobile", describedby: champ.describedby_id) diff --git a/app/views/shared/dossiers/editable_champs/_pays.html.haml b/app/views/shared/dossiers/editable_champs/_pays.html.haml index 975cfee94..d8ae7eb91 100644 --- a/app/views/shared/dossiers/editable_champs/_pays.html.haml +++ b/app/views/shared/dossiers/editable_champs/_pays.html.haml @@ -3,4 +3,5 @@ = react_component("ComboPaysSearch", required: champ.mandatory?, id: champ.input_id, + className: "width-33-desktop width-100-mobile", describedby: champ.describedby_id) diff --git a/app/views/shared/dossiers/editable_champs/_regions.html.haml b/app/views/shared/dossiers/editable_champs/_regions.html.haml index 2dadcf48c..077ece9b2 100644 --- a/app/views/shared/dossiers/editable_champs/_regions.html.haml +++ b/app/views/shared/dossiers/editable_champs/_regions.html.haml @@ -3,4 +3,5 @@ = react_component("ComboRegionsSearch", required: champ.mandatory?, id: champ.input_id, + className: "width-33-desktop width-100-mobile", describedby: champ.describedby_id)