react-multi-select icon indicating copy to clipboard operation
react-multi-select copied to clipboard

Build version not compatible with Material UI

Open Cozloschi opened this issue 6 years ago • 23 comments

Expected Behavior

Hello, I am using your multi select component in a project which uses Material UI. On the development server everything looks like expected: screen shot 2018-10-25 at 11 14 10 When I am using production build, everything looks the same except the component which uses your component: screen shot 2018-10-25 at 11 13 55

Do you have any ideea why this happens? Thank you in advance.

Steps to Reproduce the Problem

  1. Add material ui to a project
  2. Insert your component into a dialog box
  3. Open dialog box

Specifications

  • Version: 1.0.6
  • Platform: MacOS

Cozloschi avatar Oct 25 '18 08:10 Cozloschi

I am checking it, can u please add code example how do you try to use it?

talyak avatar Oct 25 '18 10:10 talyak

Thank you for your reply. Here's an example of my render function:

render() {
        return (
            <div>
                <Dialog
                    open={this.props.open}
                    aria-labelledby="form-dialog-title"
                    className={this.props.className}
                    fullWidth={true}
                    maxWidth={this.props.maxWidth}
                >
                    <DialogTitle id="form-dialog-title">{this.props.dialogTitle}</DialogTitle>
                    <DialogContent>
                        {this.props.dialogText ? <DialogContentText>
                            {this.props.dialogText}
                        </DialogContentText> : null}
                        {this.renderFields()}
                        {this.props.multiSelect && <MultiSelect
                            wrapperClassName='modalBoxMultipleSelect'
                            items={this.props.multiSelectItems}
                            selectedItems={this.state.selectedItems}
                            onChange={items => this.handleChangeSelectItem(items)}
                        />}
                    </DialogContent>
                    <DialogActions>
                        <Button onClick={this.handleClose} color="primary">
                            Cancel
                        </Button>
                        <Button onClick={() => this.saveChanges()} color="primary">
                            {this.props.submitButtonText}
                        </Button>
                    </DialogActions>
                </Dialog>
            </div>
        )
    }

I've seen that your project uses Material UI also, and from what I've read there might be css conflicts if there's two instances of material UI on the same project. https://github.com/marmelab/react-admin/issues/1782

I will try using Material UI as a peer dependency.

Cozloschi avatar Oct 25 '18 11:10 Cozloschi

update me please.

talyak avatar Oct 25 '18 11:10 talyak

Using Material Ui as a peer dependency didn't work. But wrapping my entire project in a JssProvider component did the trick. https://github.com/marmelab/react-admin/issues/1782#issuecomment-418633547

import JssProvider from 'react-jss/lib/JssProvider';

export default () => (
    <JssProvider generateClassName={generateClassName}>
        <App />
    </JssProvider>
);

I think that we should consider wrapping your project in a JssProvider, maybe this way won't be any conflicts in the future with other projects using Material UI.

Cozloschi avatar Oct 25 '18 11:10 Cozloschi

Thank you @Cozloschi for bringing this to our attention. We hope to release a new version soon that will ensure that material ui is a proper peer dependency and will use whatever version you've provided in your application.

You are also more then welcomed to provide a solution beforehand, any contribution would be greatly appreciated.

uikenshoo avatar Oct 29 '18 15:10 uikenshoo

Same issue here! would love to have a fix soon 👍

orShapira avatar Dec 13 '18 12:12 orShapira

Sorry about the delay in handling this. I think we can commit to fixing this next week.

liorheber avatar Dec 13 '18 16:12 liorheber

is there any news with this issue? I'm literally unable to use this component. and it was a really good one before!

orShapira avatar Jan 10 '19 09:01 orShapira

any updated?

Zidanela avatar Jan 22 '19 07:01 Zidanela

we've been waiting for the bug fix :(.

Zidanela avatar Jan 22 '19 07:01 Zidanela

Hi, hopefully this PR will provide the fix. https://github.com/kenshoo/react-multi-select/pull/126 Should be merged today.

liorheber avatar Jan 22 '19 11:01 liorheber

Please give v1.0.67 and let us know how it goes.

Thanks!

liorheber avatar Jan 22 '19 13:01 liorheber

Hi, this issue is still going

  1. it damaged other material-ui components behavior - such as Dialog and more...
  2. it's behavior and look itself are not as good as the development environment
  • the alignment of the checkboxes is disordered and when I click its acting without correlation to my click
  • the dialog buttons stopped working
  • the design of the modal changed when I use the react-multi-select

image

orShapira avatar Jan 28 '19 06:01 orShapira

@orShapira what material ui version are you using?

liorheber avatar Jan 28 '19 16:01 liorheber

@liorheber my stable production work with @material-ui/core:3.1.2 but I also upgraded the staging environment to @material-ui/core:3.9.2 and it also didn't work

orShapira avatar Feb 05 '19 16:02 orShapira

Well the dependency for our component is currently material-ui/[email protected] so there's a good chance this is the cause. @yegor-babiy is planning on looking into this this coming week and there's a good chance we'll update the dependency if that proves to be the root cause. We will update as soon as possible but you are also welcomed to give it a try.

liorheber avatar Feb 05 '19 16:02 liorheber

@orShapira could you please supply a live code example, because we still can't reproduce issue on our end.

yegor-babiy avatar Feb 12 '19 17:02 yegor-babiy

Hi, I am using material ui 3.9.2 version. but multi-select library uses 1.0 version. it's giving me a lot of errors. is there any solution for this??

samuelrego avatar Feb 15 '19 11:02 samuelrego

@samuelrego thanks for feedback, could you please provide more details, which errors you got, that we had ability to reproduce such issue.

yegor-babiy avatar Feb 15 '19 14:02 yegor-babiy

I've tried with v1.0.71 using material-ui v1.3.0, still having the issue

Edit: I've used a JSSProvider instead (custom generateClassName), it works like a charm. Thanks :)

baptwaels avatar Apr 03 '19 12:04 baptwaels

Same problem here ! Any solution in production mode ? I'm using "@kenshooui/react-multi-select": "^1.1.3", "@material-ui/core": "^3.9.3",

giancarlobianchi12 avatar Jul 22 '19 04:07 giancarlobianchi12

problem still exists

"@kenshooui/react-multi-select": "^1.1.6",
"@material-ui/core": "^4.11.0",

ekinertac avatar Oct 20 '20 22:10 ekinertac

@ekinertac I am facing the same problem on the same versions. Did you find any solution?

rickyalmeidadev avatar Mar 01 '21 13:03 rickyalmeidadev