Hello Isomorphic,
We have some screens with a complex layout that contains multiple dynamic forms (organized in horizontal and vertical layouts).
some of the fields in these dynamic forms have validators or other UI logic which is applied when the fields lose focus.
We are noticing some inconsistency when the user is clicking in 'empty' parts of the screen - some clicks will make the current field lose focus (and trigger the validations etc.) and other clicks do not...
To be clear - this is only when clicking in an empty area - obviously, when clicking on another form item or button, the current item always looses focus as expected.
I tried to narrow down this problem to a simple example and came up with this snippet:
When playing this example, the focus is defaulting to the name field.
Clicking in any "white" area on the screen, will not affect the focus, but clicking in the "gray" area (the background of the second dynamic form) the name field will lose focus and show the "required" validation indicator.
Of course in this example I deliberately highlited the second form with a gray background, but in our application all the forms have the same bg color so the user cannot distinguish between them and cannot really understand why some clicks do trigger the focus change (and subsequent validation) and others don't.
In general, as a user I would expect that either any click outside the field will make the field lose focus or only clicks on a specific field\control will do that (with a clear preference for the second option).
I am curios if you have any recommendation how to achieve this or whether you consider it a bug and will fix it.
I originally thought that setting the dynamic form's canFocus to false would solve that, but according to your documentation, it does not meant to work.
Thanks in advance
Gil
We have some screens with a complex layout that contains multiple dynamic forms (organized in horizontal and vertical layouts).
some of the fields in these dynamic forms have validators or other UI logic which is applied when the fields lose focus.
We are noticing some inconsistency when the user is clicking in 'empty' parts of the screen - some clicks will make the current field lose focus (and trigger the validations etc.) and other clicks do not...
To be clear - this is only when clicking in an empty area - obviously, when clicking on another form item or button, the current item always looses focus as expected.
I tried to narrow down this problem to a simple example and came up with this snippet:
Code:
var f1 = isc.DynamicForm.create({ autoFocus: true, validateOnExit: true, items:[ { name: "name", title: "Enter your name", selectOnFocus: true, wrapTitle: false, validators: [{type: "required"}] }, { name: "age", title: "Enter your age", selectOnFocus: true, wrapTitle: false } ] }); var f2 = isc.DynamicForm.create({ numCols: 3, backgroundColor: "lightgray", items:[ { name: "address1", title: "Address line 1", selectOnFocus: true, wrapTitle: false, }, { name: "address2", title: "Address line 2", selectOnFocus: true, wrapTitle: false }, { type: "button", title: "Check Address", width: 80, startRow: false, } ] }); isc.HLayout.create({ members: [f1, f2] });
When playing this example, the focus is defaulting to the name field.
Clicking in any "white" area on the screen, will not affect the focus, but clicking in the "gray" area (the background of the second dynamic form) the name field will lose focus and show the "required" validation indicator.
Of course in this example I deliberately highlited the second form with a gray background, but in our application all the forms have the same bg color so the user cannot distinguish between them and cannot really understand why some clicks do trigger the focus change (and subsequent validation) and others don't.
In general, as a user I would expect that either any click outside the field will make the field lose focus or only clicks on a specific field\control will do that (with a clear preference for the second option).
I am curios if you have any recommendation how to achieve this or whether you consider it a bug and will fix it.
I originally thought that setting the dynamic form's canFocus to false would solve that, but according to your documentation, it does not meant to work.
This property will only govern whether the form may receive focus if the form contains no focusable items.
Gil
Comment