-
Notifications
You must be signed in to change notification settings - Fork 80
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
Boolean filter sometimes needs three states: true, false, and "don't include in filter" #324
Comments
@tmecklem This has always been an interesting UI/UX "problem" to tackle. The The issue at hand is knowing when the users intention is to actually filter on the "falsey" value or their intention is to not filter on that value at all, and with a binary state input that is a hard to decipher as you pointed out. If we utilize the option to not include a hidden input for "falsey" values, then you'd only ever be able to filter on a boolean field in the truthy direction, never in the falsey. We potentially could add a new Or perhaps there can be an additional UI/UX element for the torch user to indicate that the boolean (or other) filters are "active" in the search filtering or "inactive" so they don't get sent/included. Perhaps we use a radio button with 3 states instead? Not sure radio is ideal, and select input is probably better. Thoughts? |
@tmecklem To get the ball rolling, since you didn't have any feedback, I'm going to proceed with changing boolean inputs to a "three-state" select dropdown instead of the current checkbox. |
Torch version 3.9.0 and version 4.1.0 have both been released to hex.pm which should address this issue. |
@cpjolicoeur I'm sorry I went silent for a while after submitting the issue. Thank you so much for resolving it with a fix! I think that solution works well for the use case. |
I have a record with a
valid
boolean field on it. I need to be able to filter based on valid: true, valid: false, and also to choose not to filter on it at all. If I use the filter_boolean_input, it includes valid: false as filter criteria when I'm trying to filter on some other field.For example: I searched on just the name contains criteria. It's showing two invalid companies in my results, but there's a third valid: true company that I need to be able to see as well (see second image). H
Is there a select or other boolean filter helper that accomplishes this? (Thinking something like a select with three options: true, false, and the default of "do not filter")
The text was updated successfully, but these errors were encountered: