Skip to content

InputNumber: Cannot clear if value is marked @Positive #13689

@ritonglue

Description

@ritonglue

Describe the bug

If a number is validated with jakarta.validation.constraints.Positive, you can't clear InputNumber.

Reproducer

In org.primefaces.showcase.view.input.InputNumberView add the constraint @positive to input2

    @Positive
    private Double input2 = Double.valueOf(0);

Go to /showcase/ui/input/inputNumber.xhtml

  • Change the value of the field "Currency". For example, 3
  • hit tab
  • go back to the field "Currency"
  • Try to clear the field

Expected behavior

The constraint @Positive says that "null elements are considered valid."
As a consequence one should be able to clear InputNumber

PrimeFaces edition

None

PrimeFaces version

14.0.4

Theme

No response

JSF implementation

Mojarra

JSF version

2.3

Java version

17

Browser(s)

No response

Metadata

Metadata

Assignees

Labels

🐞 defectBug...Something isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions