ComboBox and CallbackDataProvider: filter is empty when clicked even if the

I’m implementing a search box using a ComboBox and CallbackDataProvider. The backend search works fine when text is typed inside the combo, but not when the combo is clicked with existing text inside.
When using keyboard to enter text, the text is present in the filter object received in the fetch and count callback. But when the combo is clicked the filter is always an empty String…

I’ve had to workaround the issue with the help of a custom value change listener that store the last request and that reuse this request in case of an empty filter, but this is not satisfying and doesn’t feel good in the code.

Here is a sample code that emulate a backend call to reproduce the issue:

		AtomicInteger index = new AtomicInteger(0);
        AtomicInteger size = new AtomicInteger(0);
        final ComboBox<String> backend = new ComboBox<>("Backend");
        List<String> data = new ArrayList<>();
        backend.setDataProvider(new CallbackDataProvider<>(
                (CallbackDataProvider.FetchCallback<String, String>) query -> {
                    final Optional<String> filter = query.getFilter();
                    System.out.println("query: " + filter.toString());
                    if(filter.isPresent() && ! filter.get().isEmpty()) {
                        for (int i = 0; i < size.get(); i++) {
                            data.add(filter.orElse("?") + "_" + index.getAndIncrement() + "_" + RandomStringUtils.randomAlphabetic(10));
                (CallbackDataProvider.CountCallback<String, String>) query -> {
                    final Optional<String> filter = query.getFilter();
                    if(filter.isPresent() && ! filter.get().isEmpty()) {
                        final int i = RandomUtils.nextInt(5, 15);
                    else {
                    return size.get();   

Is it the expected behavior or is this a bug ?
How could I avoid the workaround and get the content of the search box on a click event ?

Thanks a lot.