Decimal value with number field failing for specific value

Avatar

Avatar

volgadr10

Avatar

volgadr10

volgadr10

23-03-2021

Hi Team,

 

In my cq:dialog I have a field with following details:

<answerScore jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/numberfield"
fieldDescription="Select Score value for this Answer."
fieldLabel="Answer Score" name="./answerScore"
required="{Boolean}true"
min="{Double}-1"
max="{Double}10"
step="{Double}0.0001"/>

 It works fine for most of the values but fails for value 2.05. Is there anything I am doing wrong?

Thanks in advance!!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Anudeep_Garnepudi

MVP

Avatar

Anudeep_Garnepudi

MVP

Anudeep_Garnepudi
MVP

23-03-2021

@volgadr10 

Even I see issue using granite/ui/components/coral/foundation/form/numberfield, working as expected using  granite/ui/components/foundation/form/numberfield. Give a try.

Answers (3)

Answers (3)

Avatar

Avatar

asutosh_j3

Avatar

asutosh_j3

asutosh_j3

23-03-2021

Hi @volgadr10 

You can use the step as "any" of type String and it will resolve the issue.
https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui...

 

Hope this helps!
Thanks!

Avatar

Avatar

Rohit_Utreja

Avatar

Rohit_Utreja

Rohit_Utreja

23-03-2021

Hi, @volgadr10,

 

The step should be a string as per the granite numberfield resource type.

step="{String}0.0001"

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/granite-ui...

Avatar

Avatar

rush_pawan

Avatar

rush_pawan

rush_pawan

23-03-2021

the step attribute is type of string not double. can you check that https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/granite-ui...