Skip to content

Commit

Permalink
fix(fe): Addition to a759393 (save code names)
Browse files Browse the repository at this point in the history
  • Loading branch information
MendyBerger committed Mar 25, 2024
1 parent 459d61d commit 4cd054d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions frontend/apps/crates/entry/classroom/src/codes/jig_codes/dom.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use components::asset_card::render_asset_card;
use dominator::{clone, html, DomBuilder, EventOptions};
use dominator::{clone, html, with_node, DomBuilder, EventOptions};
use futures_signals::{
signal::{not, Mutable, SignalExt},
signal_vec::SignalVecExt,
Expand All @@ -11,7 +11,7 @@ use utils::{
date_formatters, events,
routes::{ClassroomCodesRoute, ClassroomRoute, Route},
};
use web_sys::ShadowRoot;
use web_sys::{HtmlInputElement, ShadowRoot};

use super::JigCodes;

Expand Down Expand Up @@ -77,10 +77,15 @@ impl Component<JigCodes> for Rc<JigCodes> {
.child(html!("div", {
.class("cell")
.class("name")
.child(html!("input", {
.prop_signal("readOnly", not(editing.signal()))
.prop_signal("value", name.signal_cloned())
.focused_signal(editing.signal())
.child(html!("input" => HtmlInputElement, {
.with_node!(elem => {
.prop_signal("readOnly", not(editing.signal()))
.prop_signal("value", name.signal_cloned())
.focused_signal(editing.signal())
.event(clone!(name => move |_: events::Input| {
name.set(elem.value());
}))
})
}))
.child(html!("div", {
.class("actions")
Expand Down

0 comments on commit 4cd054d

Please sign in to comment.