Reduce render allocations and redundant work in core components
This commit is contained in:
@@ -95,8 +95,8 @@ impl RenderOnce for Field {
|
||||
|
||||
let title = div()
|
||||
.debug_selector({
|
||||
let name = format!("{id}-label");
|
||||
move || name
|
||||
let id = id.clone();
|
||||
move || format!("{id}-label")
|
||||
})
|
||||
.text_size(metrics.text_size)
|
||||
.child(self.label.clone());
|
||||
@@ -105,16 +105,16 @@ impl RenderOnce for Field {
|
||||
.items_center()
|
||||
.gap_2()
|
||||
.debug_selector({
|
||||
let name = format!("{id}-control");
|
||||
move || name
|
||||
let id = id.clone();
|
||||
move || format!("{id}-control")
|
||||
})
|
||||
.children(self.control);
|
||||
|
||||
let error = self.error.map(|error| {
|
||||
div()
|
||||
.debug_selector({
|
||||
let name = format!("{id}-error");
|
||||
move || name
|
||||
let id = id.clone();
|
||||
move || format!("{id}-error")
|
||||
})
|
||||
.text_size(metrics.caption_size)
|
||||
.text_color(error_color)
|
||||
|
||||
Reference in New Issue
Block a user