darkmoon_uk
08/09/2021, 2:25 AMTextField
and DropDownMenu
to make a fairly standard drop-down selection for a form.
For this I want to suppress the standard text-editing interaction with the TextField
and just respond to clicks by opening the menu. Found this becomes a bit of a catch 22 though:
• Keeping the TextField
enabled, and trying to apply an overriding clickable
modifier to it, or its parent, does not stop the TextField from capturing user interaction and behaving normally, as hoped.
• Disabling the TextField and applying clickable
to its parent gives desired behaviour, but then of course the colours look disabled too, which I don't want. So I'm trying to apply new TextFieldColors
to it, that maintain the enabled appearance. However I'm not finding this straightforward either - trying to reference the existing default colors gets you tangled up in interaction sources and stuff which does not feel necessary to be doing.
Any 3rd way I'm missing?darkmoon_uk
08/09/2021, 2:45 AMTextFieldColors
interface again; this seems to be a fairly robust way of optionally forcing an 'always enabled' appearance.
Using remember
to avoid re-wrapping an unchanged normalTextFieldColors
at every recomposition.darkmoon_uk
08/09/2021, 2:55 AMZach Klippenstein (he/him) [MOD]
08/09/2021, 2:49 PMText
and a border instead of trying to disable a TextField
Sean McQuillan [G]
08/12/2021, 7:59 PMdarkmoon_uk
08/13/2021, 1:36 AMTextField
to be present in this 'Drop Down' control. This also paves the way for a potential 'combo' control. In this instance, the path of least resistance still seems to be to base efforts on a `TextField`; otherwise we're faced with recreating & maintain the exact L&F of those secondary TextField
elements, in sync with the original.Sean McQuillan [G]
08/13/2021, 1:46 AMSean McQuillan [G]
08/13/2021, 1:46 AM