Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select / SetValue / TriggerUpdate with only string parameters #5502

Open
ssabw1 opened this issue Feb 7, 2024 · 0 comments
Open

Select / SetValue / TriggerUpdate with only string parameters #5502

ssabw1 opened this issue Feb 7, 2024 · 0 comments

Comments

@ssabw1
Copy link

ssabw1 commented Feb 7, 2024

this.triggerUpdate(_.get(value.data || value, searchProperty, value), true);

We have a case that this function takes the next parameters:
this.triggerUpdate(_.get(undefined || 'Cardiff', 'search', 'Cardiff'), true);

In this case we get an empty function like function search() { [native code] } and this causes to throw an error.

Maybe need to check this case like:

        var defaultValue = value;
        value = !value.data && typeof value === 'string' && typeof searchProperty === 'string' && !!searchProperty.length ? {[searchProperty]: value} : value;
        this.triggerUpdate(_.get(value.data || value, searchProperty, defaultValue), true);

Or maybe have another solution?

Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant