Repository navigation
refactor: drop obsolete scroller workaround - #7257
Merged
Merged
Conversation
vursen
marked this pull request as draft
March 22, 2024 09:35
vursen
requested review from
tomivirkki
and removed request for
tomivirkki and
web-padawan
March 22, 2024 09:36
Contributor
Author
|
Just to be on the safe side, I took the reproduction example from the original issue that the workaround aimed to fix and tested it on both Mac and Windows (Chrome). The issue was not reproducible with the workaround removed. @Route("vaadin-combo-box/bug")
public class BugPage extends Div {
static final ArrayList<String> list = new ArrayList<>();
static final int MAX_ITEMS = 500;
static {
for (int i = 1; i <= MAX_ITEMS; i++) {
list.add(String.valueOf(i));
}
}
public BugPage() {
ComboBox<String> comboBox = new ComboBox<>();
comboBox.setItems(this::items);
add(comboBox);
}
private Stream<String> items(Query<String, String> q) {
return filteredItems(q).skip(q.getOffset()).limit(q.getLimit());
}
private Stream<String> filteredItems(Query<String, String> q) {
return list.stream().filter(item -> doFilter(item, q.getFilter()));
}
private boolean doFilter(String item, Optional<String> filter) {
if (filter.isEmpty()) {
return true;
} else {
return item.contains(filter.get());
}
}
} |
vursen
marked this pull request as ready for review
March 22, 2024 09:46
|
web-padawan
approved these changes
Mar 22, 2024
tomivirkki
approved these changes
Mar 22, 2024
Collaborator
|
This ticket/PR has been released with Vaadin 24.4.0.alpha20 and is also targeting the upcoming stable 24.4.0 version. |
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Description
The
_shouldSkipIndexworkaround was introduced in vaadin/vaadin-combo-box#978 at a time combo-box had its own scroll restoration logic. However, this logic was later removed when replacing iron-list with virtualizer in #2339, which makes the workaround also obsolete. Note, there is no such workaround in grid.Type of change