LearnNewsExamplesServices
Frontmatter
id5214
titleform.field.Select: onFocusLeave() no longer clearing values with forceSelection
stateClosed
labels
bugstale
assigneestobiu
createdAtFeb 12, 2024, 3:01 PM
updatedAtSep 12, 2024, 4:28 AM
githubUrlhttps://github.com/neomjs/neo/issues/5214
authortobiu
commentsCount3
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtSep 12, 2024, 4:28 AM

form.field.Select: onFocusLeave() no longer clearing values with forceSelection

Closed v8.1.0 bugstale
tobiu
tobiu commented on Feb 12, 2024, 3:01 PM

The bug occured inside our client app and needs investigation.

The new logic seems wrong: if the widget is using the forceSelection config, 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

tobiu added the bug label on Feb 12, 2024, 3:01 PM
tobiu assigned to @tobiu on Feb 12, 2024, 3:01 PM
tobiu
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.

tobiu referenced in commit 0de7537 - "#5214 form.field.Select: onFocusLeave() debugging, cleanup" on Feb 20, 2024, 9:53 AM
tobiu referenced in commit 51079e8 - "#5214 form.field.Select: onFocusLeave()" on Feb 20, 2024, 12:00 PM
tobiu referenced in commit 7543632 - "form.field.Select: onFocusLeave() no longer clearing values with forceSelection #5214 (in progress)" on Mar 14, 2024, 4:07 PM
tobiu referenced in commit 0c87365 - "form.field.Select: onFocusLeave() no longer clearing values with forceSelection #5214 (in progress)" on Mar 15, 2024, 9:00 AM
tobiu referenced in commit 6494b7a - "#5214 form.field.Select: onFocusLeave() debugging, cleanup" on Mar 26, 2024, 5:29 PM
tobiu referenced in commit 422fe94 - "#5214 form.field.Select: onFocusLeave()" on Mar 26, 2024, 5:29 PM
tobiu referenced in commit d5204ba - "form.field.Select: onFocusLeave() no longer clearing values with forceSelection #5214 (in progress)" on Mar 26, 2024, 5:29 PM
tobiu referenced in commit dbd7246 - "form.field.Select: onFocusLeave() no longer clearing values with forceSelection #5214 (in progress)" on Mar 26, 2024, 5:29 PM