fix(ivy): call hostBindings
function with proper element index (#27694)
We invoked `hostBindings` function in Create and Update modes with different element index due to the fact that we did not subtract HEADER_OFFSET from the index before passing it to `hostBindings` function in Create mode. Now we subtract HEADER_OFFSET value before invoking `hostBindings`, which makes Ceate and Update calls consistent. PR Close #27694
This commit is contained in:

committed by
Miško Hevery

parent
4c1cd1bb78
commit
9bfe42840b
@ -198,7 +198,7 @@ export function createRootComponent<T>(
|
||||
if (tView.firstTemplatePass && componentDef.hostBindings) {
|
||||
const rootTNode = getPreviousOrParentTNode();
|
||||
setCurrentDirectiveDef(componentDef);
|
||||
componentDef.hostBindings(RenderFlags.Create, component, rootTNode.index);
|
||||
componentDef.hostBindings(RenderFlags.Create, component, rootTNode.index - HEADER_OFFSET);
|
||||
setCurrentDirectiveDef(null);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user