Solution 1 :

The field instance is passed as a third argument of the expression callback:

expressionProperties: {
    'model.testField': (m, formState, field) => {
        if (m.testField.value && field.focus === true) {
            return x;
        } else {
            return y;
        }
    }
}

Problem :

I am using ngx-formly v: 5.5.10. I try to check if field is focused in the expressionProperties.
This is necessary for changing the value based on focus. Something like this:

expressionProperties: {
    'model.testField': (m) => {
        if (m.testField.value && testField.focus=true) {
            return x;
        } else {
            return y;
        }
    }
}

Is there a formly built-in solution for checking focus in the expressionProperties?

Thanks for any help!

By