recogito / recogito-js

A JavaScript library for text annotation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Autocomplete for relations does not work as intended

deaddecoy opened this issue · comments

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.

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