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

[BUG] Numeric Max Rule not validating properly #54

Closed
4 tasks done
skillcraft-io opened this issue Jan 28, 2020 · 1 comment
Closed
4 tasks done

[BUG] Numeric Max Rule not validating properly #54

skillcraft-io opened this issue Jan 28, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@skillcraft-io
Copy link

Prerequisites

  • Able to reproduce the behaviour outside of your code, the problem is isolated to Laraform.
  • Provided all the required dependencies to reproduce the bug (eg. form, component, model, migration - all with full class).
  • Your issue isn't already filed.
  • You filled in the entire issue template.

Versions

  • PHP version: 7.2.24
  • Laravel version: 6.10
  • Laraform Vue package version and type: 1.1.10 PRO
  • Laraform Laravel package version: 1.1.9 PRO

Description

I have a form that has a Numeric Field, InputType Float (To allow for decimals). However the MAX rule does not properly validate with the decimals.

Steps to Reproduce

Create a new form:

  • type: Text
  • inputType: float
    -rule: required & max:1

Render the form and enter 1.01 in to the field

Expected behavior:

The value 1.01 SHOULD be considered invalid.

Actual behavior:

The form will not correctly validate the value exceeds max until 1 is whole @ 2.

Additional Information

None at this time.

@skillcraft-io skillcraft-io added the bug Something isn't working label Jan 28, 2020
@laraform
Copy link
Owner

laraform commented Feb 2, 2020

In order to validate a field as a number you should add numeric rule too, eg:

rules: 'required|numeric|max:1'

Anyway there was indeed a bug in the validating algorithm which is now fixed in 1.1.11, thanks for reporting.

@laraform laraform closed this as completed Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants