mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] components: make sure t-ref work with t-if/t-else
This commit is contained in:
committed by
Samuel Degueldre
parent
34b781aeed
commit
489e20843c
+2
-1
@@ -12,9 +12,10 @@ import { onMounted, onPatched, onWillUnmount } from "./component/lifecycle_hooks
|
||||
*/
|
||||
export function useRef<T extends HTMLElement = HTMLElement>(name: string): { el: T | null } {
|
||||
const node = getCurrent()!;
|
||||
const refs = node.refs;
|
||||
return {
|
||||
get el(): T | null {
|
||||
return node.refs[name] || null;
|
||||
return refs[name] || null;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user