title: In LibGDX scene2d, after changing the items of a selectbox, it no longer has a default listener
body: <p>I dont think my problem is that hard to solve but I have been searching for a while and cant figure it out.</p>
  
  <p>I have two scene2d <code>SelectBox</code> widgets one above the other, in a table, on a stage. Let's call them A and B. Whatever is selected in A determines which list is shown in B. I implement this using a <code>ChangeListener</code> on A and all works fine (this isn't the problem).</p>
  
  <p>However, my list A was getting extremely long (500+ items) so I wanted to add a <code>TextField</code> above it which would search and match the strings, replacing the old list of A with a shorter one, making it much easier to find what you are looking for. This works fine, I use a <code>ChangeListener</code> on the textfield to get the string, compare it to a main list of strings using a for loop and use <code>aList.setItems();</code> to add the adjusted string to the <code>SelectBox</code>. The list displays (without a click, so I use <code>aList.showList();</code> in the <code>ChangeListener</code> of the <code>TextField</code>) and I think this is where the problem occurs - instead of a click, <code>showList()</code> is called from elsewhere. Lets say I change my mind and want to select a different item from A, it will no longer drop down the menu on click. Yet if I change the text which is in the search bar, it displays the list. When the list is displayed, I can click an item and it hides as normal.</p>
  
  <p>This might seems a bit confusing, so here is the code (edited for clarity, so if something is missing let me know)</p>
  
  <pre><code>SelectBox aSelect, bSelect;
  TextField searchBar;
  Stage stage;
  Table table;
  Skin skin;
  
  ArrayList&lt;String&gt; completeAList;
  ArrayList&lt;String&gt; abrevAList;
  
  public chooseItemScreen()
  {
      stage = new Stage(new ScreenViewport());
      skin = new Skin(Gdx.files.internal("uiskin.json"));
      table = new Table();
      table.setFillparent(true);
  
      completeAList = new ArrayList&lt;String&gt;;
      abrevAList = new ArrayList&lt;String&gt;;
  
      aSelect = new SelectBox(skin);
      //ItemList is a class with the list of strings as a static method
      completeAList = ItemList.getAList();
      aSelect.setItems(completeAList.toArray());
  
      //bSelect omitted as is same as A
      //aSelect changeListener also omitted as it is working fine
  
      searchBar = new TextField("", skin);
      searchBar.setMessageText("SEARCH LIST");
  
      searchPokemon.addListener(new ChangeListener() {
          @Override
          public void changed(ChangeEvent event, Actor actor) {
              updateASelect();
          }
      });
  
      table.add(searchBar);
      table.row();
      table.add(aList);
  
      stage.addActor(table);
  
      Gdx.input.setInputProcessor(stage);
  
  }
  
  private void updateAList()
  {
      abrevAList.clear();
      aSelect.clearItems();
      aSelect.hideList()
  
      for (String string: completeAList)
      {
          if (string.toLowerCase().startsWith(searchBar.getText().toLowerCase()))
          {
              abrevAList.add(string);
          }
      }
  
      if (abrevAList.isEmpty())
      {
          abrevAList.add("NOT FOUND");
      }
  
      aSelect.setItems(abrevAList.toArray());
  
      //It's at this point where I am no longer to click on aSelect
      //I can still select an item from the drop down list, closing the list
      //it's just I can't show list by clicking on the widget after that
  
      aSelect.showList();
  }
  
  @Override
  public void render(float delta) {
      Gdx.gl20.glClearColor(0,0,0,0);
      Gdx.gl20.glClear(GL20.GL_COLOR_BUFFER_BIT);
  
      stage.act();
      stage.draw();
  
  }
  </code></pre>
  
  <p>I added the following listener to tell if the selectBox was being clicked (which it was). I gave all actors names</p>
  
  <pre><code>    stage.getRoot().addCaptureListener(new InputListener() {
          public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
              System.out.println(event.getTarget().getName());
              return false;
          }
      });
  </code></pre>
  
  <p>The click is recognised, just the list doesn't show. In my opinion, it is a problem with calling <code>showList()</code> and changing the list at the same time.</p>
  
  <p>Any help is appreciated, and if you need more code or any other information, let me know. </p>
  
  <p>Thanks</p>