Skip to content

Commit

Permalink
Merge pull request #568 from IdelsTak/master
Browse files Browse the repository at this point in the history
Introduce clearDragHover method for drag hover state resetting
  • Loading branch information
torakiki authored Dec 15, 2023
2 parents 472f185 + 00d2b65 commit d0d9ce0
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ private Consumer<DragEvent> onDragEnteredConsumer() {
}

private void onDragExited(DragEvent e) {
clearDragHover();
placeHolder.setDisable(true);
e.consume();
}
Expand Down Expand Up @@ -421,7 +422,7 @@ public void onLoadDocumentsRequest(PdfLoadRequest loadEvent) {
getSortOrder().clear();
getItems().addAll(dropIndex, toDrop);
focus.map(getItems()::indexOf).ifPresent(getFocusModel()::focus);
hoverIndex.setValue(-1);
clearDragHover();
this.sort();

loadEvent.getDocuments().stream().findFirst().ifPresent(
Expand Down Expand Up @@ -558,4 +559,8 @@ private int calculateHoverIndex(DragEvent event) {

return -1;
}

private void clearDragHover() {
hoverIndex.setValue(-1);
}
}

0 comments on commit d0d9ce0

Please sign in to comment.