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

height-sizing: Vertical scrollbar not showing when editor has less than 3 lines #5494

Open
marinsokol5 opened this issue Mar 5, 2024 · 1 comment

Comments

@marinsokol5
Copy link
Contributor

Describe the bug

If you create an editor using the minLines/maxLines API, so something like

var editor = ace.edit("editor3");
editor.setOptions({
    maxLines: 2,
    value: "console.log('hello world')\n".repeat(10),
});

which I added to the resize demo: https://github.com/ajaxorg/ace/blob/master/demo/autoresize.html

the vertical scrollbar is not shown for less than 3 lines, see below:

Screenshot 2024-03-05 at 10 48 54

Expected Behavior

I expect it to be shown as a user doesn't have a good indication right now that there is more content underneath.

It's shown for 3 or more lines correctly.
Screenshot 2024-03-05 at 10 54 45

Current Behavior

Scrollbar is not rendered.

Reproduction Steps

var editor = ace.edit("editor3");
editor.setOptions({
    maxLines: 2,
    value: "console.log('hello world')\n".repeat(10),
});

Possible Solution

No response

Additional Information/Context

No response

Ace Version / Browser / OS / Keyboard layout

1.32.6

@marinsokol5
Copy link
Contributor Author

Seems to be intentional, the code is in https://github.com/ajaxorg/ace/blob/master/src/virtual_renderer.js#L1053 and https://github.com/ajaxorg/ace/blob/master/src/virtual_renderer.js#L1081.

It might make sense to only enable the vertical scrollbar but not the horizontal one to still allow the Ace as Input component use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant