fix(ivy): do not inject attributes with namespace (#29257)
When injecting with `@Attribute`, namespaced attributes should not match (in order to have feature parity with View Engine). This PR resolves FW-1137 PR Close #29257
This commit is contained in:

committed by
Matias Niemelä

parent
1f0eadfab6
commit
018477e2c4
@ -279,7 +279,14 @@ export function injectAttributeImpl(tNode: TNode, attrNameToInject: string): str
|
||||
// If we hit a `Bindings` or `Template` marker then we are done.
|
||||
if (isNameOnlyAttributeMarker(value)) break;
|
||||
|
||||
if (typeof value === 'number') {
|
||||
// Skip namespaced attributes
|
||||
if (value === AttributeMarker.NamespaceURI) {
|
||||
// we skip the next two values
|
||||
// as namespaced attributes looks like
|
||||
// [..., AttributeMarker.NamespaceURI, 'http://someuri.com/test', 'test:exist',
|
||||
// 'existValue', ...]
|
||||
i = i + 2;
|
||||
} else if (typeof value === 'number') {
|
||||
// Skip to the first value of the marked attribute.
|
||||
i++;
|
||||
if (value === AttributeMarker.Classes && attrNameToInject === 'class') {
|
||||
@ -300,7 +307,6 @@ export function injectAttributeImpl(tNode: TNode, attrNameToInject: string): str
|
||||
}
|
||||
}
|
||||
} else if (value === attrNameToInject) {
|
||||
// TODO(FW-1137): Skip namespaced attributes
|
||||
return attrs[i + 1] as string;
|
||||
} else {
|
||||
i = i + 2;
|
||||
|
Reference in New Issue
Block a user