Fix behavior instructions not selecting the object when edited in NewInstructionEditorDialog

This commit is contained in:
Florian Rival
2019-07-24 23:12:02 +01:00
committed by Florian Rival
parent eb3aa28078
commit 2b64b6e97c
2 changed files with 5 additions and 4 deletions

View File

@@ -235,7 +235,7 @@ export default class InstructionOrObjectSelector extends React.Component<
{(isSearching || currentTab === 'objects') &&
displayedObjectsList.map(objectWithContext => (
<SelectorObjectListItem
key={"object-" + objectWithContext.object.ptr}
key={'object-' + objectWithContext.object.ptr}
project={project}
objectWithContext={objectWithContext}
iconSize={iconSize}
@@ -253,7 +253,7 @@ export default class InstructionOrObjectSelector extends React.Component<
{(isSearching || currentTab === 'objects') &&
displayedObjectGroupsList.map(groupWithContext => (
<SelectorGroupObjectsListItem
key={"group-" + groupWithContext.group.ptr}
key={'group-' + groupWithContext.group.ptr}
groupWithContext={groupWithContext}
iconSize={iconSize}
onClick={() =>
@@ -273,7 +273,7 @@ export default class InstructionOrObjectSelector extends React.Component<
{isSearching &&
displayedInstructionsList.map(instructionMetadata => (
<SelectorInstructionOrExpressionListItem
key={"instruction-"+instructionMetadata.type}
key={'instruction-' + instructionMetadata.type}
instructionOrExpressionMetadata={
instructionMetadata
}

View File

@@ -85,7 +85,8 @@ export default class NewInstructionEditorDialog extends React.Component<
);
if (
instructionMetadata &&
instructionMetadata.scope.objectMetadata &&
(instructionMetadata.scope.objectMetadata ||
instructionMetadata.scope.behaviorMetadata) &&
instruction.getParametersCount() > 0
) {
return this._chooseObject(instruction.getParameter(0));