Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Escape Hotkey not working to deselect Label when Taxonomy tags are present #873

Open
@davidheryanto

Description

@davidheryanto

Based on master branch as of 26 September 2022, when I configure labelling with both Labels tag and Taxonomy tag, Escape hotkey is not working to deactivate selected labels.

WIthout the Taxonomy in the labelling config, Escape hotkey works as expected. (This issue does not appear when I use Label Studio v1.3.0 and earlier)

image

Sample label config

<View>
  <Labels name="ner" toName="text">
    <Label value="Person"></Label>
    <Label value="Organization"></Label>
    <Label value="Fact"></Label>
    <Label value="Money"></Label>
    <Label value="Date"></Label>
    <Label value="Time"></Label>
    <Label value="Ordinal"></Label>
    <Label value="Percent"></Label>
    <Label value="Product"></Label>
    <Label value="Language"></Label>
    <Label value="Location"></Label>
  </Labels>
  <Text name="text" value="$text"></Text>
  <!-- If Taxonomy is removed, Escape hotkey is working as expected to deactivate labels -->
  <Taxonomy name="tax" toName="text">
    <Choice value="One" />
    <Choice value="Two" />
    <Choice value="Three">
      <Choice value="Sub" />
      <Choice value="With" />
      <Choice value="Tuna" />
    </Choice>
  </Taxonomy>
</View>

I'm not sure what's the best way to solve this Hotkey issue, but I think this event handler in Taxonomy is the one that's causing Escape to not work as expected to deactivate/deselect selected Labels (around line 468 in the code snippet below). I understand pressing Escape is meant to close the dropdown in Taxonomy selection, but it seems to prevent deactivating selected Labels as well.

https://github.com/heartexlabs/label-studio-frontend/blob/e516329c9f6300a8272809173dedf8759534ca61/src/components/Taxonomy/Taxonomy.tsx#L453-L493

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglabeling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions