Scrollbar not always showing in SelectList [FIX]

This one made me rage hard.

Under certain circumstances the SelectList’s scrollbar won’t appear. I couldn’t pinpoint exactly where or why or how, but I found out that commenting “this.getVScrollBar().hide();” fixed the issue completely without any side-effect… O_O Yeah, I know. Makes you wonder what it’s doing there in the first place.

Anyway. I tested it and it goes on/off depending if there is enough info in it or not, so afaik it’s working as intended. Maybe it’s a leftover from an past era? :wink:

Here’s the diff:

[java]

This patch file was generated by NetBeans IDE

It uses platform neutral UTF-8 encoding and \n newlines.

— Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -171,7 +171,7 @@
* @param value The value to associate with the MenuItem
*/
public void addListItem(String caption, Object value) {

  •   this.getVScrollBar().hide();
    

+// this.getVScrollBar().hide();
ListItem listItem = new ListItem(
this,
caption,
@@ -191,7 +191,7 @@
public void insertListItem(int index, String caption, Object value) {
if (!listItems.isEmpty()) {
if (index >= 0 && index < listItems.size()) {

  •   		this.getVScrollBar().hide();
    

+// this.getVScrollBar().hide();
ListItem listItem = new ListItem(
this,
caption,
@@ -208,7 +208,7 @@
* @param index int
*/
public void removeListItem(int index) {

  •   this.getVScrollBar().hide();
    

+// this.getVScrollBar().hide();
if (!listItems.isEmpty()) {
if (index >= 0 && index < listItems.size()) {
listItems.remove(index);
[/java]

The fix I implemented for this was actually a problem in ScrollPanel. The latest commits are available.