mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
committed by
Géry Debongnie
parent
af4f372506
commit
7e721a96b5
+6
-1
@@ -104,7 +104,12 @@ export function useRef(name: string): Ref {
|
||||
return {
|
||||
get el(): HTMLElement | null {
|
||||
const val = __owl__.refs && __owl__.refs[name];
|
||||
return val instanceof HTMLElement ? val : null;
|
||||
if (val instanceof HTMLElement) {
|
||||
return val;
|
||||
} else if (val instanceof Component) {
|
||||
return val.el;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
get comp(): Component<any, any> | null {
|
||||
const val = __owl__.refs && __owl__.refs[name];
|
||||
|
||||
Reference in New Issue
Block a user