Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
fix: input bug
Browse files Browse the repository at this point in the history
  • Loading branch information
flytam committed Jan 25, 2024
1 parent 4cec50e commit dccceb2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/hooks/useClipboardData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,19 @@ export const useClipboardData = ({ filter }: params = {}) => {
window.utoolClipboard.clipboardListener.on("change", changeFn);
});

const visibilitychangeCb = () => {
if (document.visibilityState === "visible") {
utools.setSubInput(
(item) => {
setFilterText(item.text);
},
"搜索内容",
true
);
}
};
document.addEventListener("visibilitychange", visibilitychangeCb);

utools.setSubInput(
(item) => {
setFilterText(item.text);
Expand All @@ -61,6 +74,7 @@ export const useClipboardData = ({ filter }: params = {}) => {
"change",
changeFn
);
document.removeEventListener("visibilitychange", visibilitychangeCb);
};
}, []);

Expand Down

0 comments on commit dccceb2

Please sign in to comment.