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

wrapLongLines and showLineNumbers overwrites the 'display' property of the style attribute from lineProps #518

Open
dfilipidisz opened this issue May 3, 2023 · 0 comments

Comments

@dfilipidisz
Copy link

Describe the bug
Using wrapLongLines and showLineNumbers together overwrites the display property of the style attribute from lineProps.

To Reproduce

<SyntaxHighlighter
  {...}
  wrapLongLines
  showLineNumbers
  lineProps={(lineNumber) => ({
    style: {
      display: 'none', // In my case this is done conditionally, but this gets the point across
    }
  })}
>
  {code}
</SyntaxHighlighter>

Expected behavior
In the above example the lines have the display: flex property, no matter what I set it to in lineProps. I'd expect it to take any value (maybe a warning in dev mode is warranted since it's expected to work with flexbox internally.)

Screenshots
Not relevant.

Desktop (please complete the following information):

  • OS: macOS, Win10
  • Browser: Chrome
  • Version: 112

Additional context
To me it looks like this line is the culprit. I've worked it around by setting height: 0; overflow: hidden to "mimic" display: none, but I've spent more time than I would dare to admit on finding out why my styles are not getting registered.

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

1 participant