# text\_input box keeps losing focus

**URL:** https://support.prodi.gy/t/text-input-box-keeps-losing-focus/5704
**Category:** Uncategorized
**Tags:** front-end, custom, review
**Created:** [June 14, 2022, 7:38pm UTC](https://support.prodi.gy/t/text-input-box-keeps-losing-focus/5704 "2022-06-14T19:38:58Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![alissa](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/alissa/32/2979_2.png) [@alissa](https://support.prodi.gy/u/alissa)
#### Post date: [June 14, 2022, 7:38pm UTC](https://support.prodi.gy/t/text-input-box-keeps-losing-focus/5704/1 "2022-06-14T19:38:58Z")

</div>

Hello! We are using a custom annotation recipe using a text input block that works just fine when running that recipe, but when I try to run prodigy review on the resulting labels the text input suddenly loses focus after every single character typed.

This is what I have in `prodigy.json`, which exactly matches the block defined in the custom recipe:

```python
  "blocks": [
    {"view_id": "html"},
    {
        "field_id": "evidence_row",
        "view_id": "text_input",
        "field_rows": 10,
        "field_label": "...",
        "field_autofocus": true
    }
  ] 

```

Would appreciate any ideas on what might be going wrong. Thanks!

---

<div class="post-metadata">

### Author: ![koaning](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/koaning/32/230_2.png) [@koaning](https://support.prodi.gy/u/koaning)
#### Post date: [June 15, 2022, 11:17am UTC](https://support.prodi.gy/t/text-input-box-keeps-losing-focus/5704/2 "2022-06-15T11:17:48Z")

</div>

Is it possible for you to share the entire recipe? There might be a mishap in your Python file that I'd like to rule out and I can confirm if I'm able to run your recipe locally. If possible, it would also help to have an example of your annotation `.jsonl` file.

---

<div class="post-metadata">

### Author: ![alissa](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/alissa/32/2979_2.png) [@alissa](https://support.prodi.gy/u/alissa)
#### Post date: [June 16, 2022, 2:42pm UTC](https://support.prodi.gy/t/text-input-box-keeps-losing-focus/5704/3 "2022-06-16T14:42:02Z")

</div>

Sorry for the late response! This is the recipe and I attached a small example of the annotation data:

```python
@prodigy.recipe(
    "annotate_evidence_rows",
    dataset=("Dataset to save answers to", "positional", None, str),
    source=("The source data as a JSONL file", "positional", None, str),
    view_id=("Annotation interface", "option", "v", str),
)
def annotate_evidence_rows(dataset: str, source: str, view_id: str = "text_input"):
    stream = JSONL(source)

    blocks = [
        {"view_id": "html"},
        {
            "field_id": "evidence_row",
            "view_id": "text_input",
            "field_rows": 10,
            "field_label": "...",
            "field_autofocus": True,
        },
    ]

    return {
        "view_id": "blocks", # Annotation interface to use
        "dataset": dataset, # Name of dataset to save annotations
        "stream": stream, # Incoming stream of examples
        "config": {
            "blocks": blocks,
        },
        "validate_answer": validate_answer,
    }

```

[evidence\_rows\_batch\_2.jsonl](https://support.prodi.gy/uploads/short-url/phxDpZm1zjv01S5b69VtiG2ryU1.jsonl) (6.9 KB)

---

<div class="post-metadata">

### Author: ![koaning](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/koaning/32/230_2.png) [@koaning](https://support.prodi.gy/u/koaning)
#### Post date: [June 20, 2022, 6:17am UTC](https://support.prodi.gy/t/text-input-box-keeps-losing-focus/5704/4 "2022-06-20T06:17:02Z")

</div>

I just tried running it locally and it seems to run fine on my end.

![CleanShot 2022-06-20 at 08.16.08](https://us1.discourse-cdn.com/flex020/uploads/prodigy/original/2X/7/740b0726f4cda7e3cc024d879707cfcb10e3b19d.gif)

Just to check, does this error persist across browsers? Have you tried both Firefox and Chrome?
