Skip to content
This repository was archived by the owner on Jul 3, 2018. It is now read-only.
This repository was archived by the owner on Jul 3, 2018. It is now read-only.

Does not support decimal values for scroll-snap-destination #22

@Oromis

Description

@Oromis

Nice polyfill, but whenever I try to use decimal values as scroll-snap-destination, it does not do anything at all. It would be very nice if the polyfill supported them, e.g. for 3-column horizontal scrolling sliders.

e.g., using

 scroll-snap-destination: 0% 33.33%;

fails for me.

As I see it, the fix is pretty easy, just replace the regex in function parseSnapCoordValue() from

/(\d+)(px|%) (\d+)(px|%)/g

to

/(\d+(?:\.\d*)?)(px|%) (\d+(?:\.\d*))(px|%)/g

I you are interested, I will submit a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions