Skip to content

Commit

Permalink
fix(widgets): πŸ› delay hover effests to show tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
wjian23 authored and M-Adoo committed Dec 14, 2024
1 parent 047bf27 commit c90db11
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/src/builtin_widgets/tooltips.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ class_names! {
/// ```no_run
/// use ribir::prelude::*;
///
/// let w = fn_widget! {
/// @Text {
/// let w = text! {
/// text: "hover to show tooltips!",
/// tooltips: "this is tooltips",
/// }
Expand Down Expand Up @@ -84,9 +83,10 @@ impl<'c> ComposeChild<'c> for Tooltips {

let wnd = BuildCtx::get().window();
let u = watch!($child.is_hover())
.delay(Duration::from_millis(150), AppCtx::scheduler())
.distinct_until_changed()
.subscribe(move |v| {
if v {
.subscribe(move |_| {
if $child.is_hover() {
$this.show(wnd.clone());
} else {
$this.hidden();
Expand Down

0 comments on commit c90db11

Please sign in to comment.