Skip to content

Commit

Permalink
Update PID row box when fetching PID (#298)
Browse files Browse the repository at this point in the history
Fixes #293
  • Loading branch information
Dominic-DallOsto authored Sep 17, 2024
1 parent 260a138 commit fcc96d9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/pidRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ function PIDRow(props: {
await props.item.fetchPID(props.type, props.autosave);
// set new value immediately (see note in handleCommit)
setValue(props.item.getPID(props.type));
// update the value of the input to match the new fetched value
(
document.getElementById(
`pid-row-input-${props.item.key}-${props.type}`,
)! as HTMLInputElement
).value = props.item.getPID(props.type) || "";
}

return (
Expand All @@ -52,6 +58,7 @@ function PIDRow(props: {
<div className="editable-container">
<input
type="text"
id={`pid-row-input-${props.item.key}-${props.type}`}
className={props.editable ? "zotero-clicky" : ""}
readOnly={!props.editable}
defaultValue={value || ""}
Expand Down

0 comments on commit fcc96d9

Please sign in to comment.