Skip to content

Commit

Permalink
fix svg
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhou121 committed Jan 9, 2025
1 parent fc64f71 commit 15360be
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/views/checkbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,20 @@ pub const DEFAULT_CHECKBOX_SVG: &str = r#"<svg xmlns="http://www.w3.org/2000/svg

fn checkbox_svg(
checked: impl SignalGet<bool> + 'static,
check_svg: impl Into<String> + Clone + 'static,
check_svg: impl Into<String> + 'static,
) -> impl IntoView {
let check = check_svg.clone();
let update_svg = move || {
if checked.get() {
check_svg.clone().into()
} else {
"".to_string()
let check_svg: String = check_svg.into();
let update_svg = {
let check_svg = check_svg.clone();
move || {
if checked.get() {
check_svg.clone()
} else {
"".to_string()
}
}
};
svg(check)
svg(check_svg)
.update_value(update_svg)
.class(CheckboxClass)
.keyboard_navigable()
Expand Down

0 comments on commit 15360be

Please sign in to comment.