concretecms / concrete5-legacy

Legacy repository for concrete5
http://www.concrete5.org
559 stars 323 forks source link

Number input page attributes error in Composer Chrome #1967

Closed ccmEnlil closed 6 years ago

ccmEnlil commented 6 years ago

In RE:

https://github.com/concrete5/concrete5-legacy/commit/65d72f995e281e514de4c41b8d1bd018d03dbffe

https://github.com/concrete5/concrete5-legacy/commit/fe37279201561c9b45db2d948bb6bc48f38b9945

I'm getting an error on the number inputs in composer with Chrome. If I enter 89000 (miles on a car for instance) the error tells me the nearest valid number is either 88999.9999 or 89000.9999 and I'm unable to save changes until I set the number input to one of these two numbers. I'm fairly new to the number input and haven't done much digging as of yet other than finding this page in reference to step="any"...

https://www.isotoma.com/blog/2012/03/02/html5-input-typenumber-and-decimalsfloats-in-chrome/

Possibly a new issue with chrome or one that was overlooked? I typically edit in FF so have no clue when this may have become a problem.

Site running on production 5.6.3.5

ccmEnlil commented 6 years ago

Adding the step='any' to the first commit above, as in the following, forces the input to increment by 1 in Chrome as it should upon my initial testing...

print Loader::helper('form')->number($this->field('value'), $value, array('style' => 'width:80px', 'step' => 'any'));

I have not tested with search form code from second commit above. Awaiting response from those more knowledgeable...

Remo commented 6 years ago

I think this change makes sense, fixed here https://github.com/concrete5/concrete5-legacy/commit/0060b90e5300dbad21ffbdc1d7b1c30b9d6bda3b