-
Notifications
You must be signed in to change notification settings - Fork 163
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
DependsOnNot bug fix with strict check #184
base: master
Are you sure you want to change the base?
Conversation
…se all form values are always strings (error when checking for integer values)
…properly (was error when picking undefined or null)
Depends on null or zero fix
Ran into this issue with the unforked epartment/nova-dependency-container as well, here's a quick repro: <?php
namespace App\Nova\Actions;
use Epartment\NovaDependencyContainer\NovaDependencyContainer;
use Laravel\Nova\Actions\Action;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Text;
class SampleDependsOnNot44 extends Action
{
const SOME_OPTION_A = 1;
const SOME_OPTION_B = 2;
const SOME_OPTION_C = 3;
public function fields()
{
return [
Select::make('Option', 'option')
->options([
self::SOME_OPTION_A => 'A, show dependency field',
self::SOME_OPTION_B => 'B, hide dependency field',
self::SOME_OPTION_C => 'C, show dependency field',
]),
NovaDependencyContainer::make([
Text::make('Hide me for option B'),
])->dependsOnNot('option', self::SOME_OPTION_B),
];
}
} Expected result: |
Sorry, just from epartment/nova-dependency-container. I'll update my above comment |
That functionality wasn |
For 'dependsOnNot' - changed 'strict check' to 'check with coercion' cause all form values are always strings.
Error occurs when checking for integer values and they comparing with string equivalents from html form.