When the mouse is dragged selection box does not appear but the console.log will appear normally
import React from 'react';
import {SelectableGroup} from 'react-selectable-fast';
import MenuExampluItem from './MenuExampluItem';
const array = [
{
name: '123',
key: 1
},
{
name: '456',
key: 2
},
{
name: '888',
key: 3
},
{
name: '777',
key: 4
}
];
export default class MenuExampleNested extends React.Component {
constructor() {
super();
this.state = {
isGlobal: true
};
}
handleSelecting() {
console.log('Drag');
}
handleSelectionClear() {
console.log('Clear');
}
handleSelectionFinish() {
console.log('Finish');
}
render() {
return (
<SelectableGroup
allowClickWithoutSelected={false}
duringSelection={this.handleSelecting}
onSelectionClear={this.handleSelectionClear}
onSelectionFinish={this.handleSelectionFinish}
className="app-test"
clickClassName="tick"
globalMouse={true}
>
{
array.map((Obj) => {
return (
<MenuExampluItem
key={Obj.key}
name={Obj.name}
/>
);
})
}
</SelectableGroup>
);
}
}
import React from 'react';
import Paper from 'material-ui/Paper';
import Menu from 'material-ui/Menu';
import MenuItem from 'material-ui/MenuItem';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import {createSelectable} from 'react-selectable-fast';
const MenuExampluItem = ({selectableRef, name}) => {
return (
<div ref={selectableRef}>
<MuiThemeProvider>
<Paper style={{width: '300px'}}>
<Menu>
<MenuItem primaryText={name} disabled={true}/>
</Menu>
</Paper>
</MuiThemeProvider>
</div>
);
};
export default createSelectable(MenuExampluItem)
When the mouse is dragged selection box does not appear but the console.log will appear normally
Here is my test code: