diegodlh / zotero-cita

Cita: a Wikidata addon for Zotero with citations metadata support
GNU General Public License v3.0
233 stars 12 forks source link

Make PID row input component React-controlled to better fix #292 and #293 #301

Closed diegodlh closed 3 days ago

diegodlh commented 1 month ago

298 and #299 were merged to fix #292 and #293. But they seem a bit hacky to me.

Making the input component React-controlled, by passing the state variable value as its value prop, seems to solve both #292 and #293 in a simpler and more React-y way.

Remember this input component was introduced to replace an Editable component around 973e924 until we found a way to import Zotero components. See https://github.com/diegodlh/zotero-cita/commit/f1792e787db2d97a7544af48d118a517e6804f2c#r146509552

Dominic-DallOsto commented 1 month ago

I quickly tested this and it seems to work well in the main Zotero pane, but in the citation editor I get the following bug:

  1. Open the citation editor for a cited item with a DOI and a QID
  2. Delete the QID
  3. Press save, then open the citation editor again
  4. Now fetch the QID, the progress popup will say it was successful but the pid row text box doesn't update
  5. Press save, close, then reopen the citation editor
  6. The QID is displayed
Dominic-DallOsto commented 3 days ago

This should have been fixed by #300