Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Dec 17, 2024
1 parent 1261381 commit ce4d988
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion client/src/components/Popper/Popper.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createPopper } from "@popperjs/core";
import { mount } from "@vue/test-utils";

import PopperComponent from "./Popper.vue";
import { createPopper } from "@popperjs/core";

jest.mock("@popperjs/core", () => ({
createPopper: jest.fn(() => ({
Expand Down
5 changes: 3 additions & 2 deletions client/src/components/Popper/Popper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
import { library } from "@fortawesome/fontawesome-svg-core";
import { faTimesCircle } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { type Placement } from "@popperjs/core";
import type { PropType } from "vue";
import { ref, watch } from "vue";
import { type Placement } from "@popperjs/core";
import { usePopper, type Trigger } from "./usePopper";
import { type Trigger, usePopper } from "./usePopper";
library.add(faTimesCircle);
Expand Down
5 changes: 3 additions & 2 deletions client/src/components/Popper/usePopper.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { mount } from "@vue/test-utils";
import { ref, nextTick } from "vue";
import { createPopper } from "@popperjs/core";
import { mount } from "@vue/test-utils";
import { nextTick, ref } from "vue";

import { usePopper } from "./usePopper";

jest.mock("@popperjs/core", () => ({
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/Popper/usePopper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ export function usePopper(
const doOpen = () => (visible.value = true);
const doClose = () => (visible.value = false);
const doCloseForDocument = (e: Event) => {
if (!reference.value?.contains(e.target as Node) && !popper.value?.contains(e.target as Node))
if (!reference.value?.contains(e.target as Node) && !popper.value?.contains(e.target as Node)) {
visible.value = false;
}
};

const addEventListener = (target: EventTarget, event: string, handler: EventListener) => {
Expand Down

0 comments on commit ce4d988

Please sign in to comment.