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

Issue with interaction prop #217

Open
Meemaw opened this issue Oct 14, 2021 · 0 comments
Open

Issue with interaction prop #217

Meemaw opened this issue Oct 14, 2021 · 0 comments

Comments

@Meemaw
Copy link

Meemaw commented Oct 14, 2021

Hi, thanks for this great library 👍

I've been trying to use the interaction prop, and I'm having some issues.

We're defining our Media component like this:

export const breakpoints = {
  xs: 0,
  sm: 600,
  md: 768,
  lg: 1024,
  xl: 1200,
  xxl: 1600,
} as const

const interactions = {
  landscape: "not all and (orientation: landscape)",
  portrait: "not all and (orientation: portrait)",
  hover: "(hover: hover)",
  notHover: "(hover: none)",
} as const

const MediaResult = createMedia({
  breakpoints,
  interactions,
})

After, we've wanted to show something only if the device supports hover. I would expect this to work on desktop, but it doesn't:

          <Media interaction="hover">
            <AssetCardAnnotationsBuyNowContainer>
              <AssetCardBuyNow dataKey={asset} />
            </AssetCardAnnotationsBuyNowContainer>
          </Media>

I can see the following styles applied in browser:
Screenshot 2021-10-14 at 14 12 59

Any ideas?

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

1 participant