MCPcopy Create free account
hub / github.com/bajrangCoder/setu / toggle

Method toggle

src/components/custom_dropdown.rs:28–39  ·  view source on GitHub ↗
(&mut self, cx: &mut Context<Self>)

Source from the content-addressed store, hash-verified

26 is_open: false,
27 close_time: None,
28 closing_at: None,
29 close_epoch: 0,
30 }
31 }
32
33 pub fn toggle(&mut self, cx: &mut Context<Self>) {
34 // If we just closed (within 100ms), don't reopen
35 if let Some(close_time) = self.close_time
36 && close_time.elapsed() < std::time::Duration::from_millis(100)
37 {
38 self.close_time = None;
39 return;
40 }
41 if self.is_open {
42 self.begin_close(cx);

Callers 1

renderMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected