mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
tippy: Use namespace import for tippy.js.
Names like “delegate”, “Instance”, “Placement”, “Props”, and “ReferenceElement” are much too generic to make sense as named imports. The downside is that we now need to write tippy.default(…) instead of tippy(…) (because ES module namespace objects cannot be callable), but that cost is worthwhile. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
87d36d24c9
commit
9b711cda20
@@ -1,6 +1,5 @@
|
||||
import $ from "jquery";
|
||||
import type {ReferenceElement} from "tippy.js";
|
||||
import tippy from "tippy.js";
|
||||
import * as tippy from "tippy.js";
|
||||
|
||||
import {$t} from "./i18n";
|
||||
|
||||
@@ -123,8 +122,8 @@ function set_password_toggle_label(
|
||||
): void {
|
||||
$(password_selector).attr("aria-label", label);
|
||||
if (tippy_tooltips) {
|
||||
const element: ReferenceElement = $(password_selector)[0];
|
||||
const tippy_instance = element._tippy ?? tippy(element);
|
||||
const element: tippy.ReferenceElement = $(password_selector)[0];
|
||||
const tippy_instance = element._tippy ?? tippy.default(element);
|
||||
tippy_instance.setContent(label);
|
||||
} else {
|
||||
$(password_selector).attr("title", label);
|
||||
|
||||
Reference in New Issue
Block a user