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

Text overlap on selection

Open borsemayur2 opened this issue 3 years ago • 9 comments

I'm getting following error on text selection. What can be the issue? image

borsemayur2 avatar Oct 04 '21 13:10 borsemayur2

@borsemayur2 Style conflicts.

jaywcjlove avatar Oct 04 '21 14:10 jaywcjlove

highlightEnable={false} solves it. https://github.com/uiwjs/react-md-editor/issues/279#issuecomment-945658072

sametweb avatar Oct 18 '21 11:10 sametweb

@sametweb There is no problem in the Windows Chrome test.

jaywcjlove avatar Oct 18 '21 11:10 jaywcjlove

@sametweb There is no problem in the Windows Chrome test.

I'm testing in Chrome as well. I am also using TailwindCSS, maybe something from there messes it up. I didn't dive deep to understand what clashes. highlightEnable={false} solved it and I left it there.

sametweb avatar Oct 18 '21 11:10 sametweb

@sametweb You can reproduce the problem through codesandbox.io, let me debug and see.

jaywcjlove avatar Oct 18 '21 11:10 jaywcjlove

I'm testing in Chrome as well. I am also using TailwindCSS, maybe something from there messes it up. I didn't dive deep to understand what clashes. highlightEnable={false} solved it and I left it there.

Had the same issue in combination with TailwindCSS too. So I can confirm there is a conflict with TailwindCSS and the highlighting, probably it is Tailwinds css reset. highlightEnable={false} helps as a workaround.

juspky avatar Jan 03 '22 12:01 juspky

For anyone running into this years later and stubbornly insisting onhighlight, in my case the issue was highlighting on select for textarea—so they were actually lined up until the moment you clicked the text box.

border: 0px !important; resolved it for me.

pre.w-md-editor-text-pre > code,
.w-md-editor-text-input, .w-md-editor-text-input > textarea {
  font-size: 1.8rem !important;
  line-height: 1.618 !important;
  border: 0px !important;
}

JuliaMerz avatar Nov 18 '23 10:11 JuliaMerz

adding highlightEnable={false} causes font family ignored and limits lines to 2 only. minHeight maxHeight are ignored in this case. kindly provide any fix

div3791 avatar Apr 05 '24 09:04 div3791

import React from "react";
import MDEditor from '@uiw/react-md-editor/nohighlight';

const code = `**Hello world!!!**
\`\`\`js
function demo() {}
\`\`\`
`

export default function App() {
  const [value, setValue] = React.useState(code);
  return (
    <div className="container">
      <MDEditor
        value={value}
        onChange={setValue}
      />
      <MDEditor.Markdown source={value} style={{ whiteSpace: 'pre-wrap' }} />
    </div>
  );
}

@div3791 You can directly remove the code highlighting.

jaywcjlove avatar Apr 05 '24 09:04 jaywcjlove