Review changes

This commit is contained in:
Davy Hélard
2026-10-07 14:07:59 +02:00
parent 7fc6db5f5a
commit ff48ac8aac
2 changed files with 20 additions and 6 deletions
@@ -152,6 +152,18 @@ export const handleAutocompletionsKeyDown = (
if (autocompletion.isExact) return state;
onInsertAutocompletion(autocompletion);
// Stop propagation to avoid closing the modal the
// field is contained in.
event.stopPropagation();
} else {
const additionalAction =
state.additionalActions[
state.selectedCompletionIndex - state.autocompletions.length
];
if (additionalAction) {
additionalAction.onClick();
}
// Stop propagation to avoid closing the modal the
// field is contained in.
event.stopPropagation();
@@ -499,7 +499,7 @@ export default class ExpressionField extends React.Component<Props, State> {
onGetAdditionalAutocompletions,
onExtractAdditionalErrors,
} = this.props;
if (!project || !instruction) return null;
if (!project) return null;
const expression = this.state.validatedValue;
@@ -509,11 +509,13 @@ export default class ExpressionField extends React.Component<Props, State> {
const parser = new gd.ExpressionParser2();
const expressionNode = parser.parseExpression(expression).get();
const objectName = gd.InstructionValidator.getObjectNameForParameter(
projectScopedContainersAccessor.get(),
instruction,
expressionType
);
const objectName = instruction
? gd.InstructionValidator.getObjectNameForParameter(
projectScopedContainersAccessor.get(),
instruction,
expressionType
)
: '';
const showDeprecatedInstructionWarning = this.context
? this.context.values.showDeprecatedInstructionWarning