]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commit
Fix for difference in behaviour between mouse and keyboard interactions on Sliders 12378/head
authorRick Curran <rickcurran@gmail.com>
Thu, 27 Jan 2022 16:13:09 +0000 (16:13 +0000)
committerRick Curran <rickcurran@gmail.com>
Thu, 27 Jan 2022 16:13:09 +0000 (16:13 +0000)
commitb9106f058be68ebeb80592ca3ac9b52747408d01
tree5d2afb07dc8a8047f31acaefdf561c184854d26f
parent8846fdad0289d1a0a80929c92a4245fcb781c662
Fix for difference in behaviour between mouse and keyboard interactions on Sliders

This fix is to resolve an issue that I encountered when using a currency-formatted value in the bound input on a slider (discussion post: https://github.com/foundation/foundation-sites/discussions/12372).

When using mouse interaction the functionality worked correctly, but moving the same slider resulted in a `NaN` error in the bound input field.

Looking at the code that deals with the movement of the slider handles, when the handles are moved it gets the value of the slider's position from a data-attribute on the slider aria-valuenow, but in the code that handles the keyboard arrow movement it was getting the value directly from the related bound input field instead.

This change modifies the code so that it gets the value from the same data-attribute for keyboard interaction as well.
js/foundation.slider.js