Options in ipywidgets combobox displaying multiple times

16 Views Asked by At

I am trying to make a simple UI where a user enters text into a combobox and based on their input the options are updated. This works but the options display multiple times. Here is the callback function

def textInput(deckID, quantity, current_db, val):
    if not db_file.closed:
        openFile(None)
    foundOne, data = searchScryfall(val.new)
    if(data):
        if(not foundOne):
            options = [x['name'] for x in data]
            combo.options = options
        else:
            current_db[deckID]

The result looks like this

Redundant options

Is there some way to reset to tell ipywidgets that the options have changed and not to just append a new list?

0

There are 0 best solutions below