Description
In packages/provider.mustache/src/AttributeMustacheProvider.ts, the getPossibleDirectBinding method has a bug where it retrieves bindingName from ATTRIBUTES_BINDING_MAP but then incorrectly passes attrName to bindingHandlers.get().
This means for attributes like class, the code looks up a class handler instead of the intended css handler (since DEFAULT_ATTRIBUTE_BINDING_MAP maps 'class' → 'css').
The method currently has a FIXME comment acknowledging this issue.
Current Behavior
getPossibleDirectBinding(attrName: string) {
const bindingName = this.ATTRIBUTES_BINDING_MAP[attrName]
return bindingName && this.bindingHandlers.get(attrName) //FIXME this.bindingHandlers.get(bindingName) ?
}
The mapped bindingName value is computed but never used in the lookup.
Expected Behavior
The method should use bindingName for the handler lookup so that attribute mappings work correctly.
Requirements
- Fix the handler lookup to use the correct binding name
- Add test case to verify the fix works correctly
- Ensure attribute mappings like 'class' → 'css' resolve the correct handler
Context
Reported by: @phillipc
Related PR: #234
Review comment: #234 (comment)