How to use the @material/animation/dist/mdc.animation.getCorrectEventName function in @material/animation

To help you get started, we’ve selected a few @material/animation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kripod / material-components-react / packages / checkbox / src / index.jsx View on Github external
import { getCorrectEventName } from '@material/animation/dist/mdc.animation';
import { MDCCheckboxFoundation } from '@material/checkbox/dist/mdc.checkbox';
import React, { PureComponent, PropTypes } from 'react';

const BROWSER_ANIMATION_END_EVENT_NAME = getCorrectEventName(window, 'animationend');

export default class Checkbox extends PureComponent {
  static propTypes = {
    className: PropTypes.string,
    checked: PropTypes.bool,
    indeterminate: PropTypes.bool,
    disabled: PropTypes.bool,
    onChange: PropTypes.func,
  };

  static defaultProps = {
    className: '',
    checked: false,
    indeterminate: false,
    disabled: false,
    onChange: () => {},
github react-mdc / react-material-components-web / packages / checkbox / src / Container.tsx View on Github external
this.element.setState((state) => ({
            foundationEventListeners: state.foundationEventListeners.update(
                getCorrectEventName(window, "animationend"),
                OrderedSet(),
                (x) => x.add(handler),
            ),
        }));
    }
github react-mdc / react-material-components-web / packages / checkbox / src / Container.tsx View on Github external
public deregisterAnimationEndHandler(handler: EventListener) {
        const evt = getCorrectEventName(window, "animationend");
        if (this.element.state.foundationEventListeners.get(evt).includes(handler)) {
            this.element.setState((state) => ({
                foundationEventListeners: state.foundationEventListeners.delete(evt),
            }));
        }
    }
    public forceLayout() {
github material-components / material-components-web / framework-examples / react / src / Checkbox.js View on Github external
registerAnimationEndHandler: handler => {
      if (this.refs.root) {
        this.refs.root.addEventListener(getCorrectEventName(window, 'animationend'), handler);
      }
    },
    deregisterAnimationEndHandler: handler => {
github material-components / material-components-web / framework-examples / react / src / Checkbox.js View on Github external
deregisterAnimationEndHandler: handler => {
      if (this.refs.root) {
        this.refs.root.removeEventListener(getCorrectEventName(window, 'animationend'), handler)
      }
    },
    registerChangeHandler: handler => {