- Issue created by @Debra
- ๐จ๐ฆCanada Debra
I was able to remove the decimals by modifying bef_sliders.js and in the format setting when creating the slider, apply the parseInt function to the 'to' and 'from' values.
noUiSlider.create(slider, { range: { 'min': parseFloat(sliderOptions.min), 'max': parseFloat(sliderOptions.max) }, step: parseFloat(sliderOptions.step), animate: !!sliderOptions.animate, animationDuration: parseInt(sliderOptions.animate), orientation: sliderOptions.orientation, start: [defaultMin, defaultMax], format: { // 'to' the formatted value. Receives a number. to: function (value) { //return Math.trunc(Number(value)); return parseInt(value); }, // 'from' the formatted value. from: function (value) { // return Math.trunc(Number(value)); return parseInt(value);
It would be nice if this was a setting in the Exposed Filter Settings section of the view.
- Status changed to Postponed: needs info
5 months ago 4:08pm 2 August 2024 - Status changed to Closed: outdated
4 months ago 4:38pm 29 August 2024 - ๐บ๐ธUnited States smustgrave
If experiencing on 7.0.x branch please reopen.
- ๐ฎ๐ณIndia karamveersingh
still facing similar decimal issue even after upgrading BEF to release 7.0 on Drupal 10
- Status changed to Closed: cannot reproduce
about 1 month ago 1:36pm 9 November 2024 - ๐ฌ๐งUnited Kingdom mike-kelly
The issue occurs when making a range widget: in bef_sliders.js this is the case where $inputs.length = 2. In that case the float values are not truncated.
yes, exactly, can be reproduced when the range is in use.
Please find a patch attached- ๐บ๐ธUnited States smustgrave
Fixes should be in MRs and letโs add some test coverage
- ๐ง๐ชBelgium dieterholvoet Brussels
I started a MR, don't have time to work on tests right now. Note: if you're adding this patch to a site, you should apply ๐ Remove VERSION from libraries.yml Active as well. Otherwise, the JS changes won't be visible in the browser until your browser caches are cleared.
-
smustgrave โ
committed ae0b0058 on 7.0.x
Issue #3462685 by dieterholvoet, dejan0, smustgrave, Debra,...
-
smustgrave โ
committed ae0b0058 on 7.0.x
- ๐บ๐ธUnited States smustgrave
Fine to commit this as is as I found another issue that will require test coverage.