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

Text overlap on selection #276

Open
borsemayur2 opened this issue Oct 4, 2021 · 9 comments
Open

Text overlap on selection #276

borsemayur2 opened this issue Oct 4, 2021 · 9 comments

Comments

@borsemayur2
Copy link

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

@jaywcjlove
Copy link
Member

@borsemayur2 Style conflicts.

@sametweb
Copy link

highlightEnable={false} solves it.
#279 (comment)

@jaywcjlove
Copy link
Member

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

@sametweb
Copy link

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

@jaywcjlove
Copy link
Member

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

@juspky
Copy link
Contributor

juspky commented Jan 3, 2022

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.

@jaywcjlove jaywcjlove mentioned this issue Aug 9, 2022
@JuliaMerz
Copy link

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;
}

@div3791
Copy link

div3791 commented Apr 5, 2024

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

@jaywcjlove
Copy link
Member

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.

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

6 participants