DEV: Do not trigger floatkit 'hover' for touch events (#30793)

When tapping something on a touch-enabled device, `mouseMove` events are
still fired, so floatkit would still be triggered even if configured for
'hover' only. For links, this would be particularly strange, because the
tooltip would appear for a split-second, before the page navigation
occured.

To avoid this problem, we can use the more-modern 'pointerMove' event,
and check the `pointerType` to exclude 'touch'
This commit is contained in:
David Taylor
2025-01-16 12:36:47 +00:00
committed by GitHub
parent f28eb5b0dc
commit 72f4588d3b
9 changed files with 29 additions and 18 deletions

View File

@ -159,7 +159,7 @@ module(
test("it shows status tooltip", async function (assert) {
await render(hbs`<ChatChannel @channel={{this.channel}} /><DTooltips />`);
await triggerEvent(statusSelector(mentionedUser.username), "mousemove");
await triggerEvent(statusSelector(mentionedUser.username), "pointermove");
assert
.dom(".user-status-tooltip-description")