-
-
Notifications
You must be signed in to change notification settings - Fork 151
Open
Labels
DocsDocumentation needs to be added/improved/correctedDocumentation needs to be added/improved/corrected
Description
Following the docs to config global animations for all dialogs and I get a typescript type error
settings.options.show = (dom) => dom.root.animate(
[{ transform: 'scale(0)' }, { transform: 'scale(1)' }],
{ duration: 150 }
)
Type 'Animation' is not assignable to type 'void | Promise<void>'.ts(2322)
dialog-impl-standard.d.ts(22, 12): The expected type comes from the return type of this signature.
(method) Animatable.animate(keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions): Animation
This:
settings.options.show = dom => {
dom.root.animate(
[{ transform: 'scale(0)' }, { transform: 'scale(1)' }],
{ duration: 150 }
)
}
or this:
settings.options.show = dom => {
return new Promise(resolve => {
const animation = dom.root.animate(
[{ transform: 'scale(0)' }, { transform: 'scale(1)' }],
{ duration: 150 }
)
animation.onfinish = () => resolve(null)
})
}
Seem to get rid of the type error.
Should the documentation be updated to reflect this?
Metadata
Metadata
Assignees
Labels
DocsDocumentation needs to be added/improved/correctedDocumentation needs to be added/improved/corrected