Files
odoo_source/addons/web/static/tests/core
Aaron Bohy 668378b0f5 [FIX] web: useChildRef: handle conditional children
The useChildRef (used with the useForwardRefToParent hook) allows
to retrieve, from a parent component, a t-ref from a child.

Consider the following scenario:
 - have a parent calling useChildRef
 - have a conditional (with t-if) child calling useForwardRefToParent
 - in the initial rendering, the child is displayed
  -> ref.el points to the correct html element
 - re-render s.t. the child is no longer displayed
  -> ref.el is null, because the referenced element doesn't exist
 - re-render s.t. the child is displayed again

Before this commit, at this point, ref.el will always be null,
even though the corresponding element comes back into the DOM. This
commit fixes the issue by correctly updating the ref, each time the
useForwardRefToParent hook is called.

closes odoo/odoo#100937

X-original-commit: 78d39c79993d1d63c189164f8104e5a3c90f2efd
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-23 08:26:01 +02:00
..
2022-08-31 18:53:51 +02:00
2022-08-31 18:53:51 +02:00
2022-08-31 18:53:51 +02:00
2022-08-31 18:53:51 +02:00
2022-08-31 18:53:51 +02:00
2022-08-31 18:53:51 +02:00