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

Bug: Highlighting selection on active line doesn't work #406

Closed
notmedia opened this issue Nov 13, 2022 · 13 comments
Closed

Bug: Highlighting selection on active line doesn't work #406

notmedia opened this issue Nov 13, 2022 · 13 comments

Comments

@notmedia
Copy link

notmedia commented Nov 13, 2022

Hi! The problem here is that when you setup selection color it doesn't highlight selection on active line. For default theme it works.

In this example I selected '#4D4D4C', string, you can see that match selection worked.

Screenshot 2022-11-14 at 00 56 21

@jaywcjlove
Copy link
Member

image

const [settings, setSettings] = useState<CreateThemeOptions['settings']>({
background: '#ffffff',
foreground: '#4D4D4C',
caret: '#AEAFAD',
selection: '#D6D6D6',
selectionMatch: '#D6D6D6',
gutterBackground: '#FFFFFF',
gutterForeground: '#4D4D4C',
gutterBorder: '#ddd',
gutterActiveForeground: '',
lineHighlight: '#EFEFEF',
});

@notmedia I found no errors.

@notmedia
Copy link
Author

@jaywcjlove Hey! Try to select text on active line, you may see that selection is invisible there

@jaywcjlove
Copy link
Member

I fixed it. @notmedia Upgrade v4.14.2

@notmedia
Copy link
Author

notmedia commented Nov 17, 2022

@jaywcjlove Hi! Thank you, but I found another bug here.
If you define selection color and lineHighlight color then selection is also invisible on active line.
So the lineHighlight overrides it.

image

@jaywcjlove
Copy link
Member

jaywcjlove commented Nov 18, 2022

https://codesandbox.io/embed/codemirror-uiwjs-react-codemirror-issues-406-s6m8mc?fontsize=14&hidenavigation=1&theme=dark

I created a new codemirror example to test it. Looks fine.

selection word, lineHighlight hides

Maybe I didn't understand your question.

@notmedia

@notmedia
Copy link
Author

notmedia commented Nov 18, 2022

@jaywcjlove I took a video

Screen.Recording.2022-11-18.at.16.40.00.mov

@jaywcjlove
Copy link
Member

image

I understand, I see the official solution is to set the transparent background color.

@notmedia

@notmedia
Copy link
Author

notmedia commented Nov 18, 2022

@jaywcjlove But on official webpage it works as expected(

Screen.Recording.2022-11-18.at.17.30.16.mov

@jaywcjlove
Copy link
Member

image

@notmedia using a transparent color

@notmedia
Copy link
Author

@jaywcjlove Yeah, it works! Thank you :)

@elitenas
Copy link

I think the bug here is that if the text is selected... the activeLine class should be removed. This bug was introduced after 4.11.6

@notmedia
Copy link
Author

notmedia commented Feb 18, 2023

No, because you need to see active line in selection if you select multiple lines

@elitenas
Copy link

if we set activeLine to transparent to see the highlight or selection then we dont see which line is active ever

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

3 participants