New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
focused:from bindings on can-slot cause DOM focus method to be called, causing layout thrashing #5511
Comments
I'm currently hot-patching my local copy of It makes zero sense to process them for slots anyway, as they're elements that are never actually present in the real DOM tree and are just kept around in memory to pass along bindings, afaict. Bindings that should work like view model bindings, and not element bindings. As far as other workarounds go: attempting to explicitly use Wonder if it's possible to update |
Can confirm that modifying the // ### getObservableFrom.attribute
// Returns a compute that is two-way bound to an attribute or property on the element.
attribute: function(bindingData, bindingContext ) {
if(bindingData.name === "this") {
return canReflect.assignSymbols({}, {
"can.getValue": function() {
return bindingContext.element;
},
"can.valueHasDependencies": function() {
return false;
},
"can.getName": function getName() {
//!steal-remove-start
return "<"+bindingContext.element.nodeName+">";
//!steal-remove-end
}
});
} else if (bindingContext.element.nodeName.toLowerCase() === "can-slot") {
return new SimpleObservable(undefined);
} else {
return new AttributeObservable(bindingContext.element, bindingData.name, {}, bindingData.event);
}
} Also feels considerably faster to go through the initial UI build-up in my application which uses lots of slot-based composition. [EDIT] Profiled it with Chrome and it indeed shaves ~100ms off. |
Thanks for reporting! |
Hey @rjgotten , what do you want to achieve with this binding if the property will be removed? |
I'm passing a Just using the name |
How often can you reproduce it?
Description:
Steps to reproduce:
Component
which passes values through acan-slot
bindingfocused:from="anyViewModelProperty"
anyViewModelProperty
focused
behavior fromcan-attribute-observable/behaviors
runs and tries to execute the DOMfocus
method on the<can-slot>
element.Expected results:
Special behaviors such as
focused
are not applied tocan-slot
and this problem is not triggered.Actual results:
Special behaviors are applied and this problem is triggered, causing performance degredation during large view updates.
Environment:
can
versionThe text was updated successfully, but these errors were encountered: