Top
ComboBox - Remote/async data source
ComboBox
To configure the <ComboBox /> with async data, specify dataSource to be a Promise or a function returning a Promise.
If you pass a Promise or a function returning a Promise as a dataSource, the dataSource is immediately loaded, and as soon as the Promise resolves, the data is available in the <ComboBox />.
So with the default configuration, the dataSource is not lazily loaded when the user expands the <ComboBox />.
However, you can lazily load a dataSource on demand, by using lazyDataSource. See the example below
If lazyDataSource is true, the dataSource is called only when filtering/expanding the <ComboBox /> and not when the component is mounted. If lazyDataSource is set to false, the dataSource will be called as soon as the component is rendered/mounted.
If you want to remotely filter dataSource, use remoteFilter prop.
If remoteFilter is set to true, dataSource must be a function returning a Promise.
See the example below that simulates an API call that also filters the available items.