Behaviour Fix on new record addition (#3113)
* Delete record if no company added * EditMode on First column of new row added * Fix * Minor fixes * Passed scopeId * Changed FieldInputs to accept onChange handler * Removed getFieldType --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
@ -38,6 +38,7 @@ type DoubleTextInputProps = {
|
||||
event: MouseEvent | TouchEvent,
|
||||
newDoubleTextValue: FieldDoubleText,
|
||||
) => void;
|
||||
onChange?: (newDoubleTextValue: FieldDoubleText) => void;
|
||||
};
|
||||
|
||||
export const DoubleTextInput = ({
|
||||
@ -51,6 +52,7 @@ export const DoubleTextInput = ({
|
||||
onEscape,
|
||||
onShiftTab,
|
||||
onTab,
|
||||
onChange,
|
||||
}: DoubleTextInputProps) => {
|
||||
const [firstInternalValue, setFirstInternalValue] = useState(firstValue);
|
||||
const [secondInternalValue, setSecondInternalValue] = useState(secondValue);
|
||||
@ -70,6 +72,11 @@ export const DoubleTextInput = ({
|
||||
): void => {
|
||||
setFirstInternalValue(newFirstValue);
|
||||
setSecondInternalValue(newSecondValue);
|
||||
|
||||
onChange?.({
|
||||
firstValue: newFirstValue,
|
||||
secondValue: newSecondValue,
|
||||
});
|
||||
};
|
||||
|
||||
const [focusPosition, setFocusPosition] = useState<'left' | 'right'>('left');
|
||||
|
||||
Reference in New Issue
Block a user