react-md-editor icon indicating copy to clipboard operation
react-md-editor copied to clipboard

MUI Input Label Support

Open aress31 opened this issue 1 year ago • 5 comments

Please see the code below and associated render:

const MDEditorField = (props) => {
  const { formData, schema, onChange, ...propsRest } = props;
  const theme = useTheme();

  return (
    <FormControl error={!!propsRest.rawError} fullWidth>
      <InputLabel htmlFor={schema.name}>{schema.title}</InputLabel>
      <Box>
        <MDEditor
          id={schema.name}
          value={formData}
          data-color-mode={theme.palette.mode}
          onChange={(value) => onChange(value)}
          {...propsRest}
        />
      </Box>
      {propsRest.error && <FormHelperText>{propsRest.error}</FormHelperText>}
    </FormControl>
  );
};

image

If someone could kindly tell me how to fix the style, and properly integrate the LabelInput that would be great - also could be worth it documenting this.

aress31 avatar Nov 03 '24 15:11 aress31

@aress31 There is a conflict in the styles.

jaywcjlove avatar Nov 04 '24 02:11 jaywcjlove

@jaywcjlove, what would be a fix?

aress31 avatar Nov 04 '24 04:11 aress31

https://github.com/uiwjs/react-md-editor/blob/2520e88123bde4f4d31415bb362183964f94ca48/core/src/index.less#L48-L49

@aress31 We’ve added some !important CSS styles to increase specificity for compatibility with certain component libraries. Please review and submit a PR if needed.

jaywcjlove avatar Nov 04 '24 04:11 jaywcjlove

@jaywcjlove it didn't fix the issue, MUI is one of the most used UI library - making react-md-editor compatible with it out of the box is important.

aress31 avatar Nov 23 '24 23:11 aress31

@jaywcjlove no update, example to show how to achieve this?

aress31 avatar Jan 08 '25 11:01 aress31