Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional peek distance values #586

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

callumbwhyte
Copy link

When configuring distance values, such as with peek, all options must be supplied else Glide fails to render.

This works:

{
    peek: {
        before: 50,
        after: 100
    }
}

But setting only a single property breaks:

{
    peek: {
        before: 50
    }
}

This is because peek.after is NaN which then breaks the various calculations.

My changes ensure toInt and toFloat will always return a default value of 0, which ensures calculations continue to work.

@jedrzejchalubek
Copy link
Member

This fallback needs to be done at the Peek component. The utility functions should not have this kind of logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants