Skip to content

Commit

Permalink
Fix missing feild value in Metadata Editor
Browse files Browse the repository at this point in the history
The latest release of JupyterLab updated to the latest release
of blueprintjs core, which included an async bugfix for
`InputGroup` which broke how our async update interacts with fields.
Causing any already rendered `InputGroup` to not update it value
on an async call to `uodate()` such as the one we do after calling
the metadata api.

I solved this by making the rendering of the display_name field
conditional on the existance of an inital value, just like we
already do with the other fields.

Fixes elyra-ai#883
  • Loading branch information
ajbozarth committed Aug 21, 2020
1 parent 3e5d1cc commit 4ace903
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions packages/metadata-common/src/MetadataEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ export class MetadataEditor extends ReactWidget {
this.handleDirtyState(true);
// Special case because all metadata has a display name
if (schemaField === 'display_name') {
this.displayName = event.nativeEvent.srcElement.value;
this.displayName = event.nativeEvent.target.value;
} else {
this.metadata[schemaField] = event.nativeEvent.srcElement.value;
this.metadata[schemaField] = event.nativeEvent.target.value;
}
}

Expand Down Expand Up @@ -450,15 +450,17 @@ export class MetadataEditor extends ReactWidget {
return (
<div className={ELYRA_METADATA_EDITOR_CLASS}>
<h3> {headerText} </h3>
{this.renderTextInput(
'Name',
'',
'display_name',
this.displayName,
'(required)',
false,
intent
)}
{this.displayName
? this.renderTextInput(
'Name',
'',
'display_name',
this.displayName,
'(required)',
false,
intent
)
: null}
{inputElements}
<FormGroup className={'elyra-metadataEditor-saveButton'}>
<Button
Expand Down

0 comments on commit 4ace903

Please sign in to comment.