[SOLVED] noUiSlider throwing JS error if only one product or all values are same
7 years 4 months ago - 7 years 4 months ago #307046
by lousyfool
Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
[SOLVED] noUiSlider throwing JS error if only one product or all values are same was created by lousyfool
-- HikaShop version -- : 4.1.0 [1905241756]
-- Joomla version -- : 3.9.6
-- PHP version -- : 7.2
-- Error-message(debug-mod must be tuned on) -- : Uncaught Error: noUiSlider (13.1.4): 'range' 'min' and 'max' cannot be equal.
Hi,
The new noUiSlider, used in a filter module as "cursor" on price, is causing trouble if there's only a single product in the listing, or multiple products with the same price for all.
The error breaks following JS, of course.
See attachments for complete error in console, as well as filter settings.
Thanks for a quick fix.
-- Joomla version -- : 3.9.6
-- PHP version -- : 7.2
-- Error-message(debug-mod must be tuned on) -- : Uncaught Error: noUiSlider (13.1.4): 'range' 'min' and 'max' cannot be equal.
Hi,
The new noUiSlider, used in a filter module as "cursor" on price, is causing trouble if there's only a single product in the listing, or multiple products with the same price for all.
The error breaks following JS, of course.
See attachments for complete error in console, as well as filter settings.
Thanks for a quick fix.
Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Last edit: 7 years 4 months ago by lousyfool. Reason: Solved
Please Log in or Create an account to join the conversation.
7 years 4 months ago #307054
by lousyfool
Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Replied by lousyfool on topic noUiSlider throwing JS error if only one product or all values are the same
Removing the code
from nouislider.min.js fixes the issue, indeed.
Code:
if(e.min===e.max)throw new Error("noUiSlider ("+ut+"): 'range' 'min' and 'max' cannot be equal.");
Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Please Log in or Create an account to join the conversation.
7 years 4 months ago #307049
by nicolas
Replied by nicolas on topic noUiSlider throwing JS error if only one product or all values are the same
Hi,
Thank you for your feedback and the details on the issue. That's apparently a common issue with noUISlider:
github.com/leongersen/noUiSlider/issues/236
github.com/leongersen/noUiSlider/issues/633
It's been reported several times and they decided to not support that case in noUISlider.
So I've made a patch on our end to skip the display of noUISlider alltogether in such case (there is no point in having it anyways as there is nothing to select in the first place).
You can download the HikaShop install package on our website and install it on yours to get the patch.
Thank you for your feedback and the details on the issue. That's apparently a common issue with noUISlider:
github.com/leongersen/noUiSlider/issues/236
github.com/leongersen/noUiSlider/issues/633
It's been reported several times and they decided to not support that case in noUISlider.
So I've made a patch on our end to skip the display of noUISlider alltogether in such case (there is no point in having it anyways as there is nothing to select in the first place).
You can download the HikaShop install package on our website and install it on yours to get the patch.
Please Log in or Create an account to join the conversation.
7 years 4 months ago #307076
by lousyfool
Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Replied by lousyfool on topic noUiSlider throwing JS error if only one product or all values are the same
Brilliant - thank you, Nicolas, for your quick fix! Your patch is working well, of course.
(And I replaced my modded nouislider.min.js with the original one again
)
(And I replaced my modded nouislider.min.js with the original one again
Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
The following user(s) said Thank You: Mohamed Thelji
Please Log in or Create an account to join the conversation.
Time to create page: 0.174 seconds