Fix hot reloading identical event handler closures (#3270)
This commit is contained in:
1 parent
f257529bec
commit
a7806583b2
1 file changed
+14
-1
@@ -621,7 +621,20 @@ impl HotReloadResult {
|
|||||||
// If it isn't a literal, try to find an exact match for the attribute value from the last build
|
// If it isn't a literal, try to find an exact match for the attribute value from the last build
|
||||||
_ => {
|
_ => {
|
||||||
let value_index = self.full_rebuild_state.dynamic_attributes.position(|a| {
|
let value_index = self.full_rebuild_state.dynamic_attributes.position(|a| {
|
||||||
!matches!(a.name, AttributeName::Spread(_)) && a.value == attribute.value
|
// Spread attributes are not hot reloaded
|
||||||
|
if matches!(a.name, AttributeName::Spread(_)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if a.value != attribute.value {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// The type of event handlers is influenced by the event name, so te cannot hot reload between different event
|
||||||
|
// names
|
||||||
|
if matches!(a.value, AttributeValue::EventTokens(_)) && a.name != attribute.name
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
true
|
||||||
})?;
|
})?;
|
||||||
HotReloadAttributeValue::Dynamic(value_index)
|
HotReloadAttributeValue::Dynamic(value_index)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user