fix: Improve Usability of Adding Options via Return Key for Multi-Select Field (#7450)

Fixes #6602

This is the approach that I followed based on these comments
https://github.com/twentyhq/twenty/issues/6602#issuecomment-2356870311,
https://github.com/twentyhq/twenty/issues/6602#issuecomment-2330737907
- Create forward ref in `<TextInput>` component
- Create ref to select text in parent component
`<SettingsDataModelFieldSelectFormOptionRow>` and pass it to
`<TextInput>`

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
Ngan Phan
2024-10-07 04:06:51 -07:00
committed by GitHub
parent db9ec58f5d
commit 2bc7974da9
4 changed files with 23 additions and 20 deletions

View File

@ -1,9 +1,9 @@
import { H2Title } from 'twenty-ui';
import { Section } from '@/ui/layout/section/components/Section';
import { TextInput } from '@/ui/input/components/TextInput';
import { TextArea } from '@/ui/input/components/TextArea';
import styled from '@emotion/styled';
import { ServerlessFunctionNewFormValues } from '@/settings/serverless-functions/hooks/useServerlessFunctionUpdateFormState';
import { TextArea } from '@/ui/input/components/TextArea';
import { TextInput } from '@/ui/input/components/TextInput';
import { Section } from '@/ui/layout/section/components/Section';
import styled from '@emotion/styled';
import { H2Title } from 'twenty-ui';
const StyledInputsContainer = styled.div`
display: flex;
@ -25,7 +25,7 @@ export const SettingsServerlessFunctionNewForm = ({
<TextInput
placeholder="Name"
fullWidth
focused
autoFocusOnMount
value={formValues.name}
onChange={onChange('name')}
/>