LearnNewsExamplesServices
Frontmatter
id5254
titleform.field.Select: beforeSetValue()
stateClosed
labels
bug
assigneestobiu
createdAtFeb 20, 2024, 12:03 PM
updatedAtFeb 20, 2024, 12:05 PM
githubUrlhttps://github.com/neomjs/neo/issues/5254
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 20, 2024, 12:05 PM

form.field.Select: beforeSetValue()

Closed v8.1.0 bug
tobiu
tobiu commented on Feb 20, 2024, 12:03 PM

this.record does get overruled at the end of the method.

this code is weird:

    beforeSetValue(value, oldValue) {
        let me           = this,
            displayField = me.displayField,
            store        = me.store,
            record;

        if (Neo.isObject(value)) {
            me.record = value;
            return value[displayField];
        } else {
            record = store.isFiltered() ? store.allItems.get(value) : store.get(value);

            if (record) {
                me.record = record;
                return record[displayField];
            }
        }

        me.record = store.find(displayField, value)[0] || null;

        return value
    }

this.record should get set to null in case the local record var is undefined.

@ExtAnimal

tobiu added the bug label on Feb 20, 2024, 12:03 PM
tobiu assigned to @tobiu on Feb 20, 2024, 12:03 PM
tobiu
tobiu Feb 20, 2024, 12:05 PM

wait. actually it is ok, since further checks trigger a return right away.

tobiu closed this issue on Feb 20, 2024, 12:05 PM