Skip to content

Issue with interaction prop聽#217

Description

@Meemaw

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions