HumanSignal / label-studio

Label Studio is a multi-type data labeling and annotation tool with standardized output format
https://labelstud.io
Apache License 2.0
18.39k stars 2.31k forks source link

HyperText showLabels misbehaving #1413

Open victor-ab opened 3 years ago

victor-ab commented 3 years ago

Describe the bug "null" label is displayed instead of no label name. when showLabels="false". Default behaviour also differs from what's specified in the documentation regarding showLabels. https://labelstud.io/tags/hypertext.html

To Reproduce Steps to reproduce the behavior: When annotating HyperText and adding showLabels="false", a "null" label is displayed.

Expected behavior No label name should be displayed when showLabels="false".

Screenshots image

Environment (please complete the following information):

makseq commented 3 years ago

@smoreface please, check the docs about it

smoreface commented 3 years ago

hmm, @hlomzik seems like a bug? do docs describe the intended behavior (highlight occurs but label is not displayed), or is displaying "null" instead of the label intended behavior?

hlomzik commented 3 years ago

Hi! "null" is wrong for sure, that's not for humans :) This parameter is very rare, so there may be some errors. I'll check and fix it soon

victor-ab commented 3 years ago

@hlomzik Besides the "null", the showLabels default value is False in the docs, but True in reality

victor-ab commented 3 years ago

@hlomzik @makseq I am not a js specialist, but think I found the bug. I think it is here There should be a check for (label != null) before setting the label text attribute.

hlomzik commented 3 years ago

yes, looks like the right place, thanks! I'll try it today about showLables — it's complicated a bit, it has different default values for different object tags, but I'll check this as well