Frontmatter
| id | 5214 |
| title | form.field.Select: onFocusLeave() no longer clearing values with forceSelection |
| state | Closed |
| labels | bugstale |
| assignees | tobiu |
| createdAt | Feb 12, 2024, 3:01 PM |
| updatedAt | Sep 12, 2024, 4:28 AM |
| githubUrl | https://github.com/neomjs/neo/issues/5214 |
| author | tobiu |
| commentsCount | 3 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Sep 12, 2024, 4:28 AM |
form.field.Select: onFocusLeave() no longer clearing values with forceSelection
tobiu assigned to @tobiu on Feb 12, 2024, 3:01 PM

tobiu
Feb 12, 2024, 5:25 PM
I think it is related to the change from hintRecordId to activeRecordId, which have a different purpose.
hint => the not selected record which matches via autoComplete
we now also have activeRecord and record, which have the same purpose.
The bug occured inside our client app and needs investigation.
The new logic seems wrong: if the widget is using the
forceSelectionconfig, non matching values need to get cleared. Without the config, arbitrary entries are allowed and must not get cleared.onFocusLeave(data) { let me = this; if (!me.record) { if (me.forceSelection) { me.value = me.forceSelection ? me.activeRecordId : null; } // If we exit without selecting a record, clear the filter input value. else { me.getInputEl().value = ''; } } // Clear any typeahead hint me.updateTypeAheadValue(''); // The VDOM must not carry the empty string permanently. Only while clearing the value. if (!me.record && !me.forceSelection) { delete me.getInputEl().value; } super.onFocusLeave(data) }@ExtAnimal