From 4d0975ea339014c28afe710ae2af73e2a4381d29 Mon Sep 17 00:00:00 2001 From: Oege Dijk Date: Fri, 24 Apr 2026 08:57:24 +0200 Subject: [PATCH] Fix Select to render native . This makes id/name land on a real form control and lets HTMX attributes pass through unmodified. Co-Authored-By: Claude Opus 4.6 --- monsterui/franken.py | 4 ++++ nbs/02_franken.ipynb | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/monsterui/franken.py b/monsterui/franken.py index d300ebc..4970ce0 100644 --- a/monsterui/franken.py +++ b/monsterui/franken.py @@ -839,6 +839,10 @@ def Select(*option, # Options for the select dropdown (can use `Optio inp_cls, cls, cls_custom= map(stringify, (inp_cls, cls, cls_custom)) select_kwargs = ifnone(select_kwargs, {}) + if not (searchable or insertable): + if id and not name: name = id + return fh.Select(*option, cls=('uk-select', inp_cls), id=id, name=name, **kwargs) + if 'hx_trigger' not in kwargs: kwargs['hx_trigger']='' if 'change' in kwargs['hx_trigger']: if not id: id = fh.unqid() diff --git a/nbs/02_franken.ipynb b/nbs/02_franken.ipynb index 05023ed..18b8ad1 100644 --- a/nbs/02_franken.ipynb +++ b/nbs/02_franken.ipynb @@ -1754,6 +1754,10 @@ " inp_cls, cls, cls_custom= map(stringify, (inp_cls, cls, cls_custom))\n", " select_kwargs = ifnone(select_kwargs, {})\n", "\n", + " if not (searchable or insertable):\n", + " if id and not name: name = id\n", + " return fh.Select(*option, cls=('uk-select', inp_cls), id=id, name=name, **kwargs)\n", + "\n", " if 'hx_trigger' not in kwargs: kwargs['hx_trigger']=''\n", " if 'change' in kwargs['hx_trigger']:\n", " if not id: id = fh.unqid()\n",