height-sizing: Vertical scrollbar not showing when editor has less than 3 lines
marinsokol5 opened this issue · comments
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](https://private-user-images.githubusercontent.com/30181549/310065012-3a83de52-40fa-415a-b9da-2a07ba6a6b07.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE4NjYzMjYsIm5iZiI6MTcyMTg2NjAyNiwicGF0aCI6Ii8zMDE4MTU0OS8zMTAwNjUwMTItM2E4M2RlNTItNDBmYS00MTVhLWI5ZGEtMmEwN2JhNmE2YjA3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI1VDAwMDcwNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI2OWFiMDcxZjI5ZDM0YTU4NjRjOWYwZDMwZjhiODQ1ZTE0Njg0Mjk1ZjRlZGNlMjViMGIxZGM2NDdkNjQ2M2EmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.a4GURpZLQ-WFogGWMOL6uEzxeXDYEdwfWWid0ODkEsE)
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.
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
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.