I was working on a project recently where I wanted to add/remove options from a combobox. It turns out that this is surprisingly difficult to do, with the only technique I could find for doing so (cloning all the options and creating a new state for the combobox) being really clunky and inefficient, in response I made a PR ( Combobox enhancement: add `add_option` and `extract_options` functions to allow easier addition/removal of options by Adam-Ladd · Pull Request #2684 · iced-rs/iced · GitHub ) which adds some functions (add_option and extract options) for combobox which improve this somewhat. However, I couldn’t implement some features I’d like, such as checking if an option is already present when inserting an option, as the only trait requirements on the options in a combobox are:
T: Display + Clone
This also meant that I couldn’t create a function to remove an option as the lack of PartialEq means I can’t check for equality (it might be possible to find an index by checking against the option_matchers but I’m not sure if this can be guaranteed to give the correct results).
Therefore, I am considering developing a new widget (either for a PR to iced or as it’s own crate) based on the combobox but which is designed for easy addition/removal of options.
Please let me know if you would be interested in this widget and if so what functionality you would like
Thanks,