searchspring / snap

Snap is Searchspring's latest front end integration SDK
https://searchspring.github.io/snap/
MIT License
9 stars 2 forks source link

Facet Slider Formatting #364

Open korgon opened 2 years ago

korgon commented 2 years ago

Currently the slider formatting is handled via sprintf set within the SMC - however this has been found to have limitations. Currently it is not possible to format numbers with comma separators (as one example).

There is either lack of support within sprintf itself, or within the JS library we are using.

Proposed solutions are to update our sprintf if possible to support this - or find an alternative way to set formatting options for the facet slider component.

julesbravo commented 2 years ago

I'd recommend using NumberFormat.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

korgon commented 1 year ago

Modifying format outside of the SMC goes against future self service goals. However, for custom cases we may want to add a prop to the component that would accept a function to replace the formatValue from the SMC.

Closely related to https://github.com/searchspring/snap/issues/715