Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

fix(ripple): Export getMatchesProperty #234

Conversation

codesuki
Copy link
Contributor

This will be useful to keep browser compatibility for people implementing components using ripple.

This will be useful to keep browser compatibility for people implementing components using ripple.
Copy link
Contributor

@traviskaufman traviskaufman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the initiative on this! I agree that it could be useful.

However, if we're going to export this, we should probably put it in util.js within mdc-ripple and write some tests for it.

@traviskaufman
Copy link
Contributor

Actually, it looks like we already do export this within our util.js class (sorry, been a minute since I looked at that code specifically). Could you not just import @material/ripple/util and use it that way?

@codesuki
Copy link
Contributor Author

codesuki commented Feb 2, 2017

You are right. It is already exported. I got confused because in the react example I used
import {MDCRipple, MDCRippleFoundation} from '@material/ripple/dist/mdc.ripple';.

I tried it again and reproduced the error I had.

In line with the current sample I used the compiled .js file from dist/ which does not contain getMatchesProperty.
If I try to import from @material/ripple I get the following compile error:

Uncaught SyntaxError: Unexpected token import

ripple/index.js

import {MDCComponent} from '@material/base'; <--- 

So maybe it's a webpack configuration issue.

In my private project I actually am using this successfully

import { getMatchesProperty } from '@material/ripple/util';```

This pullreq. can be closed, sorry.

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

Successfully merging this pull request may close these issues.

2 participants