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

Onclick for row element doesn't work #1

Open
amorri40 opened this issue Jul 6, 2017 · 1 comment
Open

Onclick for row element doesn't work #1

amorri40 opened this issue Jul 6, 2017 · 1 comment

Comments

@amorri40
Copy link

amorri40 commented Jul 6, 2017

First of all thanks for the excellent component, however I have found one bug:
Adding an onclick event doesn't get put in the DOM when using react-clusterize but does when using vanilla clusterize. Example:

import React from 'react';
import ReactDOM from 'react-dom';
import Clusterize from 'react-clusterize';
 
const rows = [];
const maxRows = 10000;
for (let i = 0; i < maxRows; ++i) {
    rows[i] = (
        <div style={{ borderBottom: '1px solid #f0f0f0', padding: '5px 10px' }}>
            <a onclick="window.alert('not called')">Item #{i + 1}</a>
        </div>
    );
}
rows.length = maxRows;
 
const mountNode = document.getElementById('#container');
 
ReactDOM.render(<Clusterize rows={rows} />, mountNode);

I have tried combinations of onclick, onClick and different types of parameters: binding a function in react, using a code string etc. But none of them seem to be loading.
Many thanks

@krazyjakee
Copy link

Sadly, this goes for all functionality.

Clusterize.js only supports strings for rows so this plugin reduces all components to strings thus losing all React functionality. You would have to modify the underlying library to accept React components to get this functionality.

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

2 participants