diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2023-07-06 12:48:33 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2023-07-06 15:00:29 +0200 |
commit | 9a6f1dccc4e24467e73dd2a9bb5f7e81b1116d19 (patch) | |
tree | 4e29aa55f38ef3e6482367ad51421302166c0330 /ishtar_common/widgets.py | |
parent | 6eee2676bde3fc72d57338540fc4ce89847c2cb6 (diff) | |
download | Ishtar-9a6f1dccc4e24467e73dd2a9bb5f7e81b1116d19.tar.bz2 Ishtar-9a6f1dccc4e24467e73dd2a9bb5f7e81b1116d19.zip |
🐛 wizards: fix autofocus of first field
Diffstat (limited to 'ishtar_common/widgets.py')
-rw-r--r-- | ishtar_common/widgets.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index 2bcc598bf..131051077 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -757,7 +757,6 @@ class JQueryAutoComplete(forms.TextInput): ) else: dynamic_limit.append("id_" + lim.replace("_", "")) - dct = { "source": mark_safe(source), "field_id": field_id, @@ -765,6 +764,8 @@ class JQueryAutoComplete(forms.TextInput): "modify": self.modify, "dynamic_limit": dynamic_limit, } + if self.attrs.get("autofocus", False): + dct["autofocus"] = True if self.associated_model: model_name = self.associated_model._meta.object_name.lower() dct["model_name"] = model_name |