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

Pass field context as third argument to matchFieldOptionValue() #42

Open
1 of 2 tasks
gr2m opened this issue Mar 27, 2022 · 0 comments
Open
1 of 2 tasks

Pass field context as third argument to matchFieldOptionValue() #42

gr2m opened this issue Mar 27, 2022 · 0 comments

Comments

@gr2m
Copy link
Owner

gr2m commented Mar 27, 2022

Please avoid duplicates

What’s missing?

The current matchFieldOptionValue constructor options receives two arguments

function (fieldOptionValue, userValue) {
  // return true or false
}

I suggest we pass a 3rd context argument

function (fieldOptionValue, userValue, context) {
  // return true or false
}

context would look like this

{
  field: {
    name: "My Field",
    userName: "myField",
    // maybe also `type`, and `options`, but we could add that later
  }
}

That way we could add more context in future, e.g. project, which would be the current project instance.

Why?

The way options are matched might differ depending on the field

Alternatives you tried

:shrug

Would you be interested in contributing the feature?

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

No branches or pull requests

1 participant