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

undefined or null width/height results in match #3

Open
navgarcha opened this issue Mar 9, 2017 · 1 comment
Open

undefined or null width/height results in match #3

navgarcha opened this issue Mar 9, 2017 · 1 comment

Comments

@navgarcha
Copy link

navgarcha commented Mar 9, 2017

Within the context of 'react-container-query', when passing initialSize={{ width: undefined }} or initialSize={{ width: null }} you get a true in matchQueries for that className to be applied.

I would think we'd want false to be set here wherever we have a none numerical value passed in. Granted you could do a check like initialSize={width && { width }} to get around this but this seems a bit verbose.

@navgarcha navgarcha changed the title undefined width/value results in match undefined or null width/height results in match Mar 9, 2017
@d6u
Copy link
Member

d6u commented Mar 10, 2017

So the current behavior is:

{min|max}Width would be ignored if width is not provided.

Same thing for height.

const query = {
   a: {minWidth: 400, maxWidth: 500, minHeight: 500, maxHeight: 600},
   b: {minHeight: 500, maxHeight: 600},
 };

matchQueries(query)({height: 550});

Above code return {a: true, b: true} in current behavior. Are you suggesting if we are missing width, all rules with {min|max}Width defined should be set to false, so above code should return {a: false, b: true}?

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

No branches or pull requests

2 participants