HumanSignal / HumanSignal/label-studio

Choice pre-selection does not work if `perRegion` is set

Open
#2,130 7 comments 0 reactions 0 assignees View on GitHub
labeling problem
Dominant language
TypeScript
Stars
28.3k
Forks
3.7k
Avg merge
14h
Merged PRs (30d)
15

Description

Normally setting `selected="true"` in a Choice element will pre-select that choice. However, this does not work if the `perRegion="true"` flag is also set.

This was mentioned in another issue, and the playground example illustrates the bug:

>
> Hi, @sfczekalski ! There is `selected="true"` parameter for Choice that preselects one of checkboxes (check [docs](https://labelstud.io/tags/choice.html#Parameters)). Is that what you're looking for ?

Seems not work when `perRegion` is true, check [this playground](https://labelstud.io/playground/?config=%3CView%3E%3Cbr%3E%20%20%3CLabels%20name%3D%22label%22%20toName%3D%22text%22%3E%3Cbr%3E%20%20%20%20%3CLabel%20value%3D%22label%22%2F%3E%3Cbr%3E%20%20%3C%2FLabels%3E%3Cbr%3E%20%20%3Cbr%3E%20%20%3CChoices%20name%3D%22choice%22%20toName%3D%22text%22%20choice%3D%22multiple%22%20perRegion%3D%22true%22%3E%3Cbr%3E%20%20%20%20%3CChoice%20value%3D%22choice1%22%20selected%3D%22true%22%2F%3E%3Cbr%3E%20%20%20%20%3CChoice%20value%3D%22choice2%22%2F%3E%3Cbr%3E%20%20%3C%2FChoices%3E%3Cbr%3E%3Cbr%3E%20%20%3CText%20name%3D%22text%22%20value%3D%22%24text%22%2F%3E%3Cbr%3E%3C%2FView%3E%3Cbr%3E).

_Originally posted by @function2-llx in https://github.com/heartexlabs/label-studio/issues/538#issuecomment-894910439_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.