Refresh marker panel on marker create (#2502)

* Update scene markers on create
* Improve display of markers without titles
* Fix marker title not populating
This commit is contained in:
WithoutPants
2022-04-21 11:33:04 +10:00
committed by GitHub
parent 340f47cda8
commit 9e606feb76
6 changed files with 21 additions and 7 deletions

View File

@@ -382,6 +382,16 @@ export const MarkerTitleSuggest: React.FC<IMarkerSuggestProps> = (props) => {
value: item?.title ?? "",
}));
const initialIds = props.initialMarkerTitle ? [props.initialMarkerTitle] : [];
// add initial value to items if still loading, to ensure existing value
// is populated
if (loading && initialIds.length > 0) {
items.push({
label: initialIds[0],
value: initialIds[0],
});
}
return (
<SelectComponent
isMulti={false}