Skip to content

The open alternative to Salesforce, designed for AI.

Fix form field select + form field number (#18538)

Thomas Trompette1d956702526a
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFieldInputInnerContainer.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFieldInputInnerContainer.tsx
index 0b330df0fde..860cf46f2bb 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFieldInputInnerContainer.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFieldInputInnerContainer.tsx
@@ -7,6 +7,7 @@ import { themeCssVariables } from 'twenty-ui/theme-constants';
type FormFieldInputInnerContainerProps = {
hasRightElement: boolean;
+ hoverable?: boolean;
multiline?: boolean;
readonly?: boolean;
preventFocusStackUpdate?: boolean;
@@ -16,12 +17,12 @@ type FormFieldInputInnerContainerProps = {
const StyledFormFieldInputInnerContainer = styled.div<
Omit<FormFieldInputInnerContainerProps, 'formFieldInputInstanceId'>
>`
+ align-items: center;
background-color: ${themeCssVariables.background.transparent.lighter};
border: 1px solid ${themeCssVariables.border.color.medium};
border-bottom-left-radius: ${themeCssVariables.border.radius.sm};
border-bottom-right-radius: ${({ multiline, hasRightElement }) =>
multiline || !hasRightElement ? themeCssVariables.border.radius.sm : '0'};
-
border-right: ${({ multiline, hasRightElement }) =>
multiline || !hasRightElement ? 'auto' : 'none'};
border-top-left-radius: ${themeCssVariables.border.radius.sm};
@@ -29,13 +30,23 @@ const StyledFormFieldInputInnerContainer = styled.div<
multiline || !hasRightElement ? themeCssVariables.border.radius.sm : '0'};
box-sizing: border-box;
display: flex;
+ justify-content: space-between;
overflow-x: auto;
overflow-y: ${({ multiline }) => (multiline ? 'auto' : 'hidden')};
scrollbar-width: none;
+ width: 100%;
+
&::-webkit-scrollbar {
display: none;
}
- width: 100%;
+
+ &:hover,
+ &[data-open='true'] {
+ background-color: ${({ hoverable }) =>
+ hoverable
+ ? themeCssVariables.background.transparent.light
+ : themeCssVariables.background.transparent.lighter};
+ }
`;
export const FormFieldInputInnerContainer = forwardRef(
@@ -46,6 +57,7 @@ export const FormFieldInputInnerContainer = forwardRef(
onFocus,
onBlur,
hasRightElement,
+ hoverable,
multiline,
readonly,
preventFocusStackUpdate = false,
@@ -90,6 +102,7 @@ export const FormFieldInputInnerContainer = forwardRef(
ref={ref}
className={className}
hasRightElement={hasRightElement}
+ hoverable={hoverable}
multiline={multiline}
readonly={readonly}
onFocus={handleFocus}
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiSelectFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiSelectFieldInput.tsx
index c8b858de307..a082ee4f000 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiSelectFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiSelectFieldInput.tsx
@@ -59,11 +59,6 @@ const StyledDisplayModeContainer = styled.div`
font-family: inherit;
padding-inline: ${themeCssVariables.spacing[2]};
width: 100%;
-
- &:hover,
- &[data-open='true'] {
- background-color: ${themeCssVariables.background.transparent.lighter};
- }
`;
const StyledSelectInputContainer = styled.div`
@@ -220,6 +215,7 @@ export const FormMultiSelectFieldInput = ({
<FormFieldInputInnerContainer
formFieldInputInstanceId={instanceId}
hasRightElement={isDefined(VariablePicker) && !readonly}
+ hoverable={!readonly}
>
{draftValue.type === 'static' ? (
readonly ? (
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormNumberFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormNumberFieldInput.tsx
index 80732d0baf1..0cc37da78c7 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormNumberFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormNumberFieldInput.tsx
@@ -20,6 +20,9 @@ import {
import { styled } from '@linaria/react';
const StyledInputWrapper = styled.div`
+ align-items: center;
+ display: flex;
+
& input {
padding: ${themeCssVariables.spacing[1]} ${themeCssVariables.spacing[2]};
}
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordPicker.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordPicker.tsx
index 75052fcd1bb..f6ef1c4b748 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordPicker.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordPicker.tsx
@@ -23,24 +23,15 @@ import { IconChevronDown, IconForbid } from 'twenty-ui/display';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
const StyledFormSelectContainerWrapper = styled.div<{ readonly?: boolean }>`
- align-items: center;
cursor: ${({ readonly }) => (readonly ? 'default' : 'pointer')};
+ display: flex;
height: 32px;
- justify-content: space-between;
-
- padding-right: ${themeCssVariables.spacing[2]};
-
- &:hover,
- &[data-open='true'] {
- background-color: ${({ readonly }) =>
- readonly
- ? 'transparent'
- : themeCssVariables.background.transparent.light};
- }
+ width: 100%;
`;
const StyledIconButton = styled.div`
display: flex;
+ padding-right: ${themeCssVariables.spacing[2]};
`;
export type RecordId = string;
@@ -193,6 +184,7 @@ export const FormSingleRecordPicker = ({
<FormFieldInputInnerContainer
formFieldInputInstanceId={componentId}
hasRightElement={isDefined(VariablePicker) && !disabled}
+ hoverable
preventFocusStackUpdate={true}
>
<FormSingleRecordFieldChip
diff --git a/packages/twenty-front/src/modules/ui/input/components/SettingsTextInput.tsx b/packages/twenty-front/src/modules/ui/input/components/SettingsTextInput.tsx
index 9d62dbe5cd1..0576d6452a5 100644
--- a/packages/twenty-front/src/modules/ui/input/components/SettingsTextInput.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/SettingsTextInput.tsx
@@ -123,6 +123,7 @@ export const SettingsTextInput = ({
return (
<TextInput
ref={inputRef}
+ fullWidth
// oxlint-disable-next-line react/jsx-props-no-spreading
{...props}
dataTestId={dataTestId}
diff --git a/packages/twenty-ui/src/navigation/link/components/ClickToActionLink.tsx b/packages/twenty-ui/src/navigation/link/components/ClickToActionLink.tsx
index 16175e6fff9..3c58b4c44c2 100644
--- a/packages/twenty-ui/src/navigation/link/components/ClickToActionLink.tsx
+++ b/packages/twenty-ui/src/navigation/link/components/ClickToActionLink.tsx
@@ -13,7 +13,7 @@ const StyledButtonLink = styled.a`
padding: 0 ${themeCssVariables.spacing[1]};
text-decoration: none;
- :hover {
+ &:hover {
color: ${themeCssVariables.font.color.tertiary};
cursor: pointer;
}