recogito / recogito-js

A JavaScript library for text annotation
BSD 3-Clause "New" or "Revised" License
349 stars 38 forks source link

Autocomplete for relations does not work as intended #88

Closed deaddecoy closed 11 months ago

deaddecoy commented 1 year ago

Hi, Autocomplete for relations does not work as intended

In RelationEditor.jsx -> onSubmit -> around line 50, the line: var v = this.element.current.querySelector('input').value; sets the value to the text input and not the autocomplete tag.

A quick fix might be to replace this line with: var v = this.element.current.querySelector('input').value; if (typeof e === 'string') { v = e; } const value = v;

A more ideal fix might be to rewrite the RelationEditor as a widget, like the TagWidget with similar autocomplete behavior.

deaddecoy commented 11 months ago

Was expecting behavior similar to tags. Addressed this issue in a fork by adding widget support to relations.