[FIX] web: mount on detached element
Before this commit, a component couldn't be mounted on a public widget that wasn't yet attached in the dom. closes odoo/odoo#141665 Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
This commit is contained in:
@@ -32,7 +32,11 @@ export async function attachComponent(parent, element, componentClass, props = {
|
||||
});
|
||||
}
|
||||
|
||||
const component = await app.mount(element);
|
||||
const originalValidateTarget = App.validateTarget;
|
||||
App.validateTarget = () => {};
|
||||
const mountPromise = app.mount(element);
|
||||
App.validateTarget = originalValidateTarget;
|
||||
const component = await mountPromise;
|
||||
const subComp = Object.values(component.__owl__.children)[0].component;
|
||||
return {
|
||||
component: subComp,
|
||||
|
||||
Reference in New Issue
Block a user