Skip to content
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
This repository was archived by the owner on Apr 16, 2026. It is now read-only.

Browser zoom down make issue with CodeMirror look #6258

Open

Description

@gkucmierz

Zrzut ekranu 2020-05-3 o 22 45 52

Zrzut ekranu 2020-05-3 o 22 45 46

Zrzut ekranu 2020-05-3 o 22 45 33

When browser view is zoomed down there is appearing white frame on right side and on bottom side of CodeMirror element.

Activity

  1. added a commit that references this issue on May 4, 2020
  2. marijnh commented on May 4, 2020

    @marijnh
    Member

    CodeMirror's scroll hack currently assumes scrollbars are always narrower than 30 pixels. It seems that when you zoom out enough, that assumption is violated.

    Attached patch increases this to 50px, pushing the zoom level at which the problem appears further back. Does that suffice for your use case? I'm a bit worried that setting a really big value here is going to have unexpected side effects.

  3. gkucmierz commented on May 8, 2020

    @gkucmierz
    Author

    Thank you for your response.
    Thats definetely the reason.

    I did the changes in node_modules/codemirror/… as you shown in your commit.

    Zrzut ekranu 2020-05-8 o 14 19 58

    Zrzut ekranu 2020-05-8 o 14 20 29

    This is frame with 10px variable:

    Zrzut ekranu 2020-05-8 o 14 21 44

    This is frame with 50px variable:
    Zrzut ekranu 2020-05-8 o 14 22 01

    And this is with 200px variable:

    Zrzut ekranu 2020-05-8 o 14 22 24

    All with minimum 25% zoom:

    Zrzut ekranu 2020-05-8 o 14 26 32

    Don't suggest right frame but only bottom because there is dragging panel in the right side in my case:

    Zrzut ekranu 2020-05-8 o 14 22 43

    So I think 200px is good enough in case when you zoom out 25%, and it may be good solution for now.
    But still probably it should be solved somehow more realiable than this if it is possible.

    Also I suggest to use SASS or SCSS variables instead changing one size in 5 places.

  4. Venryx commented on Jun 19, 2020

    @Venryx

    I'm a bit worried that setting a really big value here is going to have unexpected side effects.

    Indeed, this did have unintended side-effects -- well for me.

    After 3 hours of debugging, I finally identified this change as the cause of my "horizontal scrollbar showing when it should not" headaches. 🤦

    However, on further inspection just now, it appears it's not an issue in codemirror -- rather, it's that my project was importing two copies of codemirror. One version was before the change above, and one was after -- meaning one was using the 30px scroll-hack thickness, and the other was using 50px.

    That broke the "scrollbar concealing" system, because I was importing the css of the 30px version, but the code of the 50px version, causing the css-based margin-bottom and padding-bottom to not be high enough to compensate for the extra size of the code-based cm.display.heightForcer element.

    Anyway, posting this here in case anyone else made the same mistake, and hits the same issue I did...

  5. gkucmierz commented on Jun 22, 2020

    @gkucmierz
    Author

    50 pixels is still not enough to solve the issue that I described here.

  6. akdor1154 commented on Jul 25, 2020

    @akdor1154

    FYI codemirror releases from bower have an out-of-date codemirror.css, this could be where the mismatched css/js versions are coming from.

  7. added a commit that references this issue on Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions