Skip to content

Commit d08a1f4

Browse files
Uriel-SautronSharglutDev
authored andcommitted
front: inputgroupsncf: fix overflow
- add right 0 in scss file
1 parent 6fc8499 commit d08a1f4

File tree

2 files changed

+33
-27
lines changed

2 files changed

+33
-27
lines changed

front/src/common/BootstrapSNCF/InputGroupSNCF.scss

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
.input-group-sm {
22
button {
33
height: 1.875rem;
4-
font-size: .875rem;
5-
padding: .125rem 1.5rem;
4+
font-size: 0.875rem;
5+
padding: 0.125rem 1.5rem;
66
}
77
.form-control-container {
88
height: 1.875rem;
99
input.form-control {
1010
min-height: auto;
11-
font-size: .875rem;
11+
font-size: 0.875rem;
1212
}
1313
}
1414
}
@@ -21,3 +21,7 @@
2121
.dropdown-item {
2222
cursor: pointer;
2323
}
24+
25+
.osrd-dropdown-sncf {
26+
right: 0 !important;
27+
}

front/src/common/BootstrapSNCF/InputGroupSNCF.tsx

+26-24
Original file line numberDiff line numberDiff line change
@@ -179,30 +179,32 @@ export default function InputGroupSNCF({
179179
// eslint-disable-next-line react/no-unknown-property
180180
x-placement="bottom-end"
181181
>
182-
{options.map((option) => (
183-
<React.Fragment key={nextId()}>
184-
<label className="dropdown-item" htmlFor={option.id}>
185-
<div
186-
onClick={() => {
187-
setSelected(option);
188-
handleType({ type: option.id, value: 0 });
189-
setIsDropdownShown(false);
190-
}}
191-
role="button"
192-
tabIndex={0}
193-
>
194-
{option.label}
195-
</div>
196-
</label>
197-
<input
198-
type="radio"
199-
name={id}
200-
value={option.id}
201-
id={option.id}
202-
className="sr-only"
203-
/>
204-
</React.Fragment>
205-
))}
182+
<ul>
183+
{options.map((option) => (
184+
<li key={nextId()}>
185+
<label htmlFor={option.id} className="dropdown-item">
186+
<div
187+
onClick={() => {
188+
setSelected(option);
189+
handleType({ type: option.id, value: 0 });
190+
setIsDropdownShown(false);
191+
}}
192+
role="button"
193+
tabIndex={0}
194+
>
195+
{option.label}
196+
</div>
197+
</label>
198+
<input
199+
type="radio"
200+
name={id}
201+
value={option.id}
202+
id={option.id}
203+
className="sr-only"
204+
/>
205+
</li>
206+
))}
207+
</ul>
206208
</div>
207209
</div>
208210
</div>

0 commit comments

Comments
 (0)