Skip to content

Commit dbef569

Browse files
author
minjk-bl
committed
Edit SuggestInput to add scrollbar on long item list
1 parent af80d5a commit dbef569

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

visualpython/css/root.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,21 @@ button.vp-button {
378378
background: #C4C4C4;
379379
}
380380

381+
/* Scrollbar vertical only */
382+
.vp-scrollbar-vertical {
383+
overflow-x: hidden;
384+
overflow-y: auto;
385+
--webkit-mask-position: left top;
386+
}
387+
.vp-scrollbar-vertical::-webkit-scrollbar {
388+
width: 5px;
389+
height: 5px;
390+
}
391+
.vp-scrollbar-vertical::-webkit-scrollbar-thumb {
392+
border: 0.3px solid #C4C4C4;
393+
background: #C4C4C4;
394+
}
395+
381396
/* Scrollbar horizontal */
382397
.vp-scrollbar-horizontal {
383398
overflow-x: auto;

visualpython/js/com/component/SuggestInput.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ define([
168168
$(this).select();
169169
$(com_util.formatString(".{0}", that.uuid)).autocomplete('search', $(com_util.formatString(".{0}", that.uuid)).val());
170170
}).autocomplete('instance')._renderItem = function(ul, item) {
171+
$(ul).addClass('vp-scrollbar-vertical');
172+
$(ul).css('max-height', '250px');
171173
if (item.dtype != undefined) {
172174
return $('<li>').attr('data-value', item.value)
173175
.append(`<div class="vp-sg-item">${item.label}<label class="vp-gray-text vp-cursor">&nbsp;| ${item.dtype}</label></div>`)

0 commit comments

Comments
 (0)