form-validator icon indicating copy to clipboard operation
form-validator copied to clipboard

using `required()` on an `optional` field does nothing

Open Fasuh opened this issue 3 years ago • 0 comments

Describe the bug I am using global validator builder, because i want to have the same locale everywhere. bue i have noticed that whenever i am using the optional: true parameter, it overrides future required() method. i feel like it should not be an intended behaviour since the constructor of ValidationBuilder is using required()

    if (!optional) required(requiredMessage);

it should base only on that or change flag optional when we are using required()

Fasuh avatar Sep 24 '21 09:09 Fasuh