| ... | ... | @@ -428,7 +428,7 @@ fn mirrored(update: &accesskit::TreeUpdate) -> js_sys::Object { |
| 428 | 428 | let children: js_sys::Array = node |
| 429 | 429 | .children() |
| 430 | 430 | .iter() |
| 431 | | .map(|child| JsValue::from_f64(child.0 as f64)) |
| 431 | .map(|child| JsValue::from_str(&child.0.to_string())) |
| 432 | 432 | .collect(); |
| 433 | 433 | let bounds = node.bounds().map_or(JsValue::NULL, |rect| { |
| 434 | 434 | js_sys::Array::of4( |
| ... | ... | @@ -441,7 +441,7 @@ fn mirrored(update: &accesskit::TreeUpdate) -> js_sys::Object { |
| 441 | 441 | }); |
| 442 | 442 | let text = |text: Option<&str>| text.map_or(JsValue::NULL, JsValue::from_str); |
| 443 | 443 | [ |
| 444 | | JsValue::from_f64(id.0 as f64), |
| 444 | JsValue::from_str(&id.0.to_string()), |
| 445 | 445 | JsValue::from_str(&format!("{:?}", node.role())), |
| 446 | 446 | text(node.label()), |
| 447 | 447 | text(node.value()), |
| ... | ... | @@ -462,13 +462,12 @@ fn mirrored(update: &accesskit::TreeUpdate) -> js_sys::Object { |
| 462 | 462 | let _ = js_sys::Reflect::set(&mirrored, &key.into(), value); |
| 463 | 463 | }; |
| 464 | 464 | set("tree", &tree(update.tree_id)); |
| 465 | | set("focus", &JsValue::from_f64(update.focus.0 as f64)); |
| 465 | set("focus", &JsValue::from_str(&update.focus.0.to_string())); |
| 466 | 466 | set( |
| 467 | 467 | "root", |
| 468 | | &update |
| 469 | | .tree |
| 470 | | .as_ref() |
| 471 | | .map_or(JsValue::NULL, |info| JsValue::from_f64(info.root.0 as f64)), |
| 468 | &update.tree.as_ref().map_or(JsValue::NULL, |info| { |
| 469 | JsValue::from_str(&info.root.0.to_string()) |
| 470 | }), |
| 472 | 471 | ); |
| 473 | 472 | set("nodes", &nodes); |
| 474 | 473 | mirrored |
| ... | ... | @@ -486,8 +485,8 @@ pub fn accessibility(on: bool) { |
| 486 | 485 | |
| 487 | 486 | /// Assistive technology acted on node `node` of tree `tree`: 0 clicks it, 1 focuses it. |
| 488 | 487 | #[wasm_bindgen] |
| 489 | | pub fn access(tree: String, node: f64, action: u8) { |
| 490 | | let Ok(tree) = tree.parse() else { |
| 488 | pub fn access(tree: String, node: String, action: u8) { |
| 489 | let (Ok(tree), Ok(node)) = (tree.parse(), node.parse()) else { |
| 491 | 490 | return; |
| 492 | 491 | }; |
| 493 | 492 | let request = accesskit::ActionRequest { |
| ... | ... | @@ -496,7 +495,7 @@ pub fn access(tree: String, node: f64, action: u8) { |
| 496 | 495 | _ => accesskit::Action::Click, |
| 497 | 496 | }, |
| 498 | 497 | target_tree: accesskit::TreeId(tree), |
| 499 | | target_node: accesskit::NodeId(node as u64), |
| 498 | target_node: accesskit::NodeId(node), |
| 500 | 499 | data: None, |
| 501 | 500 | }; |
| 502 | 501 | send(UserEvent::Then(Box::new(move |state| { |