Skip to content
This repository has been archived by the owner on Dec 23, 2022. It is now read-only.

Warning: Unknown prop onTouchTap on <div> tag. #95

Closed
iMerica opened this issue Mar 16, 2017 · 1 comment
Closed

Warning: Unknown prop onTouchTap on <div> tag. #95

iMerica opened this issue Mar 16, 2017 · 1 comment

Comments

@iMerica
Copy link

iMerica commented Mar 16, 2017

Hi,

I'm able to add new chips, but deleting chips is not working following the README example. I'm not sure if this is because of the props warning Warning: Unknown prop onTouchTap on <div> tag or if that is a red-herring.

Here's what the code looks like:

import React from 'react';
import ChipInput from 'material-ui-chip-input'
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';

class MyChipInput extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      chips: ['foo', 'bar', 'baz']
    };
  }

  handleAdd = (chip) => {
    this.setState({
      chips: this.state.chips.concat([chip])
    });
  };

  handleDelete = (chip, index) => {
    this.setState({
      chips: this.state.chips.filter((_, i) => i !== index)
    });
  }

  render() {
    return (
      <MuiThemeProvider>
        <ChipInput
          value={this.state.chips}
          onRequestAdd={(chip) => this.handleAdd(chip)}
          onRequestDelete={() => console.log('delete!') } />
      </MuiThemeProvider>
    )
  }
}
@iMerica
Copy link
Author

iMerica commented Mar 16, 2017

This was an issue upstream with react-tap-event-plugin and material-ui. Fixed it locally by upgrading to "react-tap-event-plugin": "^2.0.1",

zilverline/react-tap-event-plugin#85

@iMerica iMerica closed this as completed Mar 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant