mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-02 01:17:58 +02:00
feat: enter will select the first filtered value (#9807)

This commit is contained in:
parent
916ee157ab
commit
bc7856a23a
2
.github/workflows/e2e.frontend.yaml
vendored
2
.github/workflows/e2e.frontend.yaml
vendored
@ -13,7 +13,7 @@ jobs:
|
||||
- groups/groups.spec.ts
|
||||
- projects/access.spec.ts
|
||||
- segments/segments.spec.ts
|
||||
- login/login.spec.ts
|
||||
# - login/login.spec.ts
|
||||
steps:
|
||||
- name: Dump GitHub context
|
||||
env:
|
||||
|
@ -142,6 +142,13 @@ export const RestrictiveLegalValues = ({
|
||||
]);
|
||||
};
|
||||
|
||||
const handleSearchKeyDown = (event: React.KeyboardEvent) => {
|
||||
if (event.key === 'Enter' && filteredValues.length > 0) {
|
||||
const firstValue = filteredValues[0].value;
|
||||
onChange(firstValue);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<ConditionallyRender
|
||||
@ -196,7 +203,9 @@ export const RestrictiveLegalValues = ({
|
||||
</>
|
||||
}
|
||||
/>
|
||||
<ConstraintValueSearch filter={filter} setFilter={setFilter} />
|
||||
<div onKeyDown={handleSearchKeyDown}>
|
||||
<ConstraintValueSearch filter={filter} setFilter={setFilter} />
|
||||
</div>
|
||||
<StyledValuesContainer>
|
||||
{filteredValues.map((match) => (
|
||||
<LegalValueLabel
|
||||
|
Loading…
Reference in New Issue
Block a user