Conversation
99509b2 to
1fde92a
Compare
1fde92a to
01a7511
Compare
01a7511 to
8adb06b
Compare
8adb06b to
e0ba76a
Compare
e0ba76a to
a869996
Compare
e30c12a to
1f450c5
Compare
f0e6f8a to
47899f6
Compare
c46b876 to
5b1388a
Compare
|
Hi @mvorisek With this PR, Lookup fields always get a clearable icon if they are either nullable or not required. I am of the opinion that a) clearable should only be activated by default if the field is not required and is nullable at the same time Furthermore I saw that on a disabled/readOnly field with `multiple = true, the clearable icon was present allowing the erase the dropdown field. Let me know if you agree, then I can work on a PR to suggest a change. |
|
Hi Michael, "almost always clearable" - what are the usecases? User should be able to revert any chenge he did on the UI side, so after selecting an option it should be always possible to clear it. The validation on send is of course always working. "multiple" - if there is an issue, PR with testcase highly welcomed! |
@mvorisek it's all well as long as you actually use a model to populate the dropdown. In my case I'm not using any models at all in my current project as all DB/data related handling is done through a rest-api. I'm just using atk4 for building the GUI. In that case creating a dropdown using setSource I will not be able to add validation in the model, I could use a check in the callback but as I'm not really interested in what the user chooses, as any value except no value is acceptable. I could use radio-buttons instead but that uses more screen-area than needed to have a minimal and consistent look. I would prefer to have setDropdownOption('clearable', false) honoured. |
|
@rickyosser Fully agree that we should still be able to programmatically configure the clearable setting, independent of the default, model-based logic. There are some use cases where the data structure allows nullable and non-required values, but you want the UI to force the user to choose a value. So needs to be independently configurable for sure. |
simillar to 6fcc1f2
fix #572
fix #2026