Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltips / Popper support #46

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tooltip: remove workaround for ios synthetic hover events, as focus d…
…oesnt work on <a>
micolous committed Jan 17, 2025
commit 37839c9addb4c03eb041727ac10de34b810a44d9
23 changes: 1 addition & 22 deletions packages/yew-bootstrap/src/component/tooltip.rs
Original file line number Diff line number Diff line change
@@ -413,28 +413,7 @@ pub fn Tooltip(props: &TooltipProps) -> Html {
let focused = focused.clone();
let hovered = hovered.clone();
Callback::from(move |evt_type: String| match evt_type.as_str() {
"mouseenter" => {
// Ignore synthetic hover events on devices that don't support
// hover at all (iOS), to make it work the same as on Android.
//
// Desktop versions of Chromium and Firefox *also* send
// MouseEnter and MouseLeave events from touchscreens, but
// generally report `hover: hover` and `any-hover: hover`, even
// when using a touchscreen, or if there is no hover-capable
// device attached.
//
// See the docs at TooltipFocusTrigger::IfAnyHoverNone for more
// details.
if let Ok(Some(query)) =
gloo_utils::window().match_media(MEDIA_QUERY_ANY_HOVER_NONE)
{
if query.matches() {
return;
}
}

hovered.set(true);
}
"mouseenter" => hovered.set(true),
"focusin" => focused.set(true),
_ => {}
})