diff --git a/examples/embeddable_examples/public/book/book_embeddable.tsx b/examples/embeddable_examples/public/book/book_embeddable.tsx index ba71222694fc85..dd9418c0e8596d 100644 --- a/examples/embeddable_examples/public/book/book_embeddable.tsx +++ b/examples/embeddable_examples/public/book/book_embeddable.tsx @@ -127,6 +127,10 @@ export class BookEmbeddable extends Embeddable { @@ -128,10 +128,9 @@ export class AttributeService< return new Promise((resolve, reject) => { const onSave = async (props: OnSaveProps): Promise => { try { + input.attributes.title = props.newTitle; const wrappedInput = (await this.wrapAttributes(input.attributes, true)) as RefType; - wrappedInput.title = props.newTitle; resolve(wrappedInput); - throw new Error(); return { id: wrappedInput.savedObjectId }; } catch (error) { reject(); @@ -144,7 +143,7 @@ export class AttributeService< reject()} - title={input.title || ''} + title={input.attributes.title} showCopyOnSave={false} objectType={this.type} showDescription={false} diff --git a/src/plugins/dashboard/public/plugin.tsx b/src/plugins/dashboard/public/plugin.tsx index 008d51f1447cc5..3b0863a9f46516 100644 --- a/src/plugins/dashboard/public/plugin.tsx +++ b/src/plugins/dashboard/public/plugin.tsx @@ -139,7 +139,7 @@ export interface DashboardStart { dashboardFeatureFlagConfig: DashboardFeatureFlagConfig; DashboardContainerByValueRenderer: ReturnType; getAttributeService: < - A, + A extends { title: string }, V extends EmbeddableInput & { attributes: A }, R extends SavedObjectEmbeddableInput >(