Skip to content

Commit

Permalink
Use text inputs for PID rows in the citations pane
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic-DallOsto committed Jul 9, 2024
1 parent f06437b commit 973e924
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
4 changes: 0 additions & 4 deletions src/cita/zoteroOverlay.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
import Wikicite, { debug } from "./wikicite";
import Citations from "./citations";
import CitationsBoxContainer from "../containers/citationsBoxContainer";
Expand Down
31 changes: 18 additions & 13 deletions src/components/pidRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ function PIDRow(props: {
which has been renamed and is not recommended. But won't show
in non-strict mode because Zotero devs renamed it to UNSAFE_*/}
{/* <Editable */}
{/* fix: replaced Editable with div until we work out how to import zotero components */}
<div
// type="text"
{/* fix: replaced Editable with input until we work out how to import zotero components */}
<input
type="text"
// There is a bug in Zotero's React Input component
// Its handleChange event is waiting for an options
// parameter from the child input element's onChange
Expand All @@ -91,23 +91,28 @@ function PIDRow(props: {
// ...and a ref too
// ref={textboxRef}
// autoFocus
// className={
// props.editable && !selected ? "zotero-clicky" : ""
// }
className={
props.editable && !selected ? "zotero-clicky" : ""
}
// isActive={selected}
// isReadOnly={!props.editable}
// readOnly={!props.editable}
readOnly={!props.editable}
// onAbort={handleCancel}
// onCancel={handleCancel}
onClick={handleEdit}
// onClick={handleEdit}
// onCommit={handleCommit}
onFocus={handleEdit}
// onFocus={handleEdit}
// onPaste={handlePaste} // what happens if I paste multiline?
// selectOnFocus={true}
// value={value || ""}
>
{value || ""}
</div>

// note: input needs an onchange handler or it won't render
onChange={
(event) => {
return;
} /* do something */
}
value={value || ""}
/>
</div>
<button onClick={() => onFetch()}>
<img
Expand Down

0 comments on commit 973e924

Please sign in to comment.