Replace hotkey scopes by focus stack (Part 4 - Inputs) (#12933)
# Replace hotkey scopes by focus stack (Part 4 - Inputs) This PR is the 4th part of a refactoring aiming to deprecate the hotkey scopes api in favor of the new focus stack api which is more robust. Part 1: https://github.com/twentyhq/twenty/pull/12673 Part 2: https://github.com/twentyhq/twenty/pull/12798 Part 3: https://github.com/twentyhq/twenty/pull/12910 In this part, I refactored all inputs in the app so that each input has a unique id which can be used to track the focused element.
This commit is contained in:
+2
-2
@@ -37,7 +37,7 @@ export const StyledSearchVariablesDropdownContainer = styled.div<{
|
||||
`;
|
||||
|
||||
export const WorkflowVariablePicker: VariablePickerComponent = ({
|
||||
inputId,
|
||||
instanceId,
|
||||
disabled,
|
||||
multiline,
|
||||
onVariableSelect,
|
||||
@@ -49,7 +49,7 @@ export const WorkflowVariablePicker: VariablePickerComponent = ({
|
||||
readonly={disabled}
|
||||
>
|
||||
<WorkflowVariablesDropdown
|
||||
inputId={inputId}
|
||||
instanceId={instanceId}
|
||||
onVariableSelect={onVariableSelect}
|
||||
disabled={disabled}
|
||||
objectNameSingularToSelect={objectNameSingularToSelect}
|
||||
|
||||
+3
-3
@@ -32,13 +32,13 @@ const StyledDropdownVariableButtonContainer = styled(
|
||||
`;
|
||||
|
||||
export const WorkflowVariablesDropdown = ({
|
||||
inputId,
|
||||
instanceId,
|
||||
onVariableSelect,
|
||||
disabled,
|
||||
objectNameSingularToSelect,
|
||||
multiline,
|
||||
}: {
|
||||
inputId: string;
|
||||
instanceId: string;
|
||||
onVariableSelect: (variableName: string) => void;
|
||||
disabled?: boolean;
|
||||
objectNameSingularToSelect?: string;
|
||||
@@ -46,7 +46,7 @@ export const WorkflowVariablesDropdown = ({
|
||||
}) => {
|
||||
const theme = useTheme();
|
||||
|
||||
const dropdownId = `${SEARCH_VARIABLES_DROPDOWN_ID}-${inputId}`;
|
||||
const dropdownId = `${SEARCH_VARIABLES_DROPDOWN_ID}-${instanceId}`;
|
||||
const isDropdownOpen = useRecoilComponentValueV2(
|
||||
isDropdownOpenComponentStateV2,
|
||||
dropdownId,
|
||||
|
||||
Reference in New Issue
Block a user