mui-color icon indicating copy to clipboard operation
mui-color copied to clipboard

There is a display problem at @mui/[email protected]

Open ShirasawaSama opened this issue 3 years ago • 8 comments
trafficstars

Versions

  • mui-color: 2.0.0-beta.2
  • @mui/material: 5.6.0
  • react: 18.0.0
  • @emotion/react: 11.9.0
  • @emotion/styled: 11.8.1
  • Edge Browser: 100.0.1185.29

Screenshots

image

But when I click anywhere on the UI it looks normal:

image

Codes

import React, { useState } from 'react'
import { colors } from '@mui/material'

export const colorMap: Record<string, string> = { }
for (const name in colors) if (name !== 'grey' && name !== 'blueGrey' && name !== 'common') colorMap[name] = colors[name][400]

const Comp = () => {
      const [color, setColor] = useState('#ffffff')
      return <ColorPicker
        deferred
        disableAlpha
        hideTextfield
        value={color}
        palette={colorMap}
        onChange={(color: any) => setColor('#' + color.hex)}
      />
}

I tried to delete all the above attributes, but I still couldn't solve it.

Other information

I noticed that nearly 30 style nodes are created each time picker is opened and closed, and will not be deleted.

image

image

ShirasawaSama avatar Apr 12 '22 12:04 ShirasawaSama

スクリーンショット 2022-05-09 22 34 24

I have a similar problem. Clicking does not fix it.

rnrnstar2 avatar May 09 '22 13:05 rnrnstar2

Same problem

image

chabErch avatar Jul 06 '22 17:07 chabErch

It looks like mui-color doesn't work with React 18

chabErch avatar Jul 06 '22 19:07 chabErch

I have the same problem. I compared the result of using the ColorPicker with react 17 and react 18, it looks like some styles do not apply:

Screenshot 2022-07-18 at 12 03 17 Screenshot 2022-07-18 at 12 03 00

I hope this will help add support for react 18.

Stukova avatar Jul 18 '22 07:07 Stukova

mui/styles is not supported when using React 18.

This looks like a great project, but unfortunately because of the project I am working on, React 18 is our requirement.

OldManMeta avatar Sep 04 '22 04:09 OldManMeta

This package (https://github.com/viclafouch/mui-color-input) handles this problem, supports both React 17 / 18 and MUI V5

viclafouch avatar Sep 04 '22 09:09 viclafouch

This package (https://github.com/viclafouch/mui-color-input) handles this problem, supports both React 17 / 18 and MUI V5

Thank you very much. I will try this.

ShirasawaSama avatar Sep 04 '22 09:09 ShirasawaSama

@viclafouch thanks for that!

OldManMeta avatar Sep 04 '22 10:09 OldManMeta