Skip to content

Commit

Permalink
fix: Clear alias input field after adding alias in Entry component
Browse files Browse the repository at this point in the history
  • Loading branch information
bramses committed Aug 15, 2024
1 parent caa2266 commit f04c460
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,15 @@ const Entry = ({
type="button"
onClick={async () => {
const aliasInput = document.getElementById(`alias-input-${id}`);
const alias = aliasInput.value;
if (!aliasInput) return;
const alias = aliasInput.textContent;
await onAddAlias({
id,
alias,
data,
metadata: { title, author },
});
aliasInput.value = ''; // Clear the input field
aliasInput.textContent = ''; // Clear the input field
}}
className="ms-2.5 rounded-lg bg-blue-700 px-5 py-2.5 text-sm font-medium text-white hover:bg-blue-800 focus:outline-none focus:ring-4 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
>
Expand Down

0 comments on commit f04c460

Please sign in to comment.