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

MUI Input Label Support #671

Open
aress31 opened this issue Nov 3, 2024 · 4 comments
Open

MUI Input Label Support #671

aress31 opened this issue Nov 3, 2024 · 4 comments

Comments

@aress31
Copy link

aress31 commented Nov 3, 2024

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.

@jaywcjlove
Copy link
Member

@aress31 There is a conflict in the styles.

@aress31
Copy link
Author

aress31 commented Nov 4, 2024

@jaywcjlove, what would be a fix?

@jaywcjlove
Copy link
Member

word-break: break-word !important;
white-space: pre-wrap !important;

@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.

@aress31
Copy link
Author

aress31 commented Nov 23, 2024

@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.

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